PDA

View Full Version : finding the value of a parent frame.. how do I


chris_angell
02-12-2003, 03:14 PM
how can I find the value of the url in the oppisite frame ??
ie I have opened www.jazz.com the moved to www.jazzporn.com in a frame with the name main, how in another frame can I make an alert box to tell me the url value.. I have been trying this


javascript:window.alert(parent.frames.main.location.href);

any ideas :rolleyes:

Danne
02-12-2003, 03:22 PM
Try this:

alert(parent.frames("main").location.href);

cg9com
02-12-2003, 03:29 PM
ew pervert

chris_angell
02-12-2003, 03:54 PM
it adds an element of fun back into lovin ??? try it..

spec for code..

chris_angell
02-12-2003, 04:06 PM
I have put that little bit of code into my page and it hasn't worked.. any ideas how Ican adapt it to make it work.. have a look

http://www.connectonlinepreview.co.uk/temp/

my link to a test frame

Roy Sinclair
02-12-2003, 05:02 PM
If the other page isn't in the same domain (which as you carefully pointed out, they aren't) then there's nothing a script in one frame can tell about or do to the other frame excepting load a different page. That's a deliberate feature of the browsers to prevent a web site from stealing content from other web sites (i.e. it prevents a web site like joessearchengine.com from passing the search to google.com, gathering the results and presenting it as if they performed the search themselves).

chris_angell
02-12-2003, 05:19 PM
what a bummer.. is it possible to open a page in a frame set.. then from a button on the site (say in ie frame two) make that web site go into a new window. so the one frame takes over the page