...

View Full Version : Frames on the fly



Borgtex
04-01-2003, 02:43 PM
Arg! It must be very simple, but...

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


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):


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

brothercake
04-02-2003, 03:49 PM
I'd hazard a guess that maybe bookmarklets can't read the document location .... some security reason perhaps?

Borgtex
04-02-2003, 05:00 PM
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 :(

cheesebagpipe
04-02-2003, 11:44 PM
This seems to work:


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.

Borgtex
04-03-2003, 05:53 PM
:thumbsup: Yeees! looks very strange but when something works, why ask more? ;)

Thank you cheese!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum