Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Aug 2002
    Location
    Spain
    Posts
    420
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Frames on the fly

    Arg! It must be very simple, but...

    why that doesn't works (with self.location):

    PHP Code:
    javascript:fram='<frameset rows="80,*" border="0" framespacing="0"><frame src="about:blank" name="topFrame" scrolling="NO" noresize ><frame src="'+self.location+'" name="mainFrame" onload="alert(11)"></frameset>';document.write(fram
    and that does (with an specific url):

    PHP Code:
    javascript:fram='<frameset rows="80,*" border="0" framespacing="0"><frame src="about:blank" name="topFrame" scrolling="NO" noresize ><frame src="'+'http://www.google.com'+'" name="mainFrame" onload="alert(11)"></frameset>';document.write(fram
    it's for a bookmarklet, so it must be executed from the address bar rather than from a page
    Don't resist to assimilation. Billions of Borgs can't be wrong!

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'd hazard a guess that maybe bookmarklets can't read the document location .... some security reason perhaps?
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

  • #3
    Regular Coder
    Join Date
    Aug 2002
    Location
    Spain
    Posts
    420
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by brothercake
    I'd hazard a guess that maybe bookmarklets can't read the document location .... some security reason perhaps?
    hummm I don't think so: if you change document.write(fram) by alert(fram) it shows the correct HTML with the url.
    It's very weird
    Don't resist to assimilation. Billions of Borgs can't be wrong!

  • #4
    Regular Coder
    Join Date
    Nov 2002
    Posts
    596
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This seems to work:
    Code:
    javascript&#58;fram='<frameset rows="80,*" border="0" framespacing="0"><frame src="about&#58;blank" name="topFrame" scrolling="NO" noresize ><frame src="javascript&#58;location=top.location" name="mainFrame" onload="alert(11)"></frameset>';document.write(fram);
    ..but I have no idea why.

  • #5
    Regular Coder
    Join Date
    Aug 2002
    Location
    Spain
    Posts
    420
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yeees! looks very strange but when something works, why ask more?

    Thank you cheese!
    Don't resist to assimilation. Billions of Borgs can't be wrong!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •