PDA

View Full Version : finding the frame's src


hoodymahood
05-14-2003, 05:20 PM
I have a website that runs using frames but i want to have the option to remove frames!!!

i thought the best way to do this is to reload the whole page with the contents of the main frame, but i do not know how to find this value.

I know little about the getElementbyID function but belive this could be the way to find the "src" of the main frame.

the website address is:-

http://www.flackwellheathcc.co.uk, i want to have a link to remove the righthand frame.

Weirdan
05-14-2003, 07:08 PM
Something like this:

top.location.href=top.frames[1].location.href;

hoodymahood
05-14-2003, 07:36 PM
cheers for that but i have no experience with PHP, can it be coded inside HTML or will i need to convert the page to PHP?

Nightfire
05-14-2003, 07:45 PM
It's javascript he's posted, just in the php code highlight :)

Just putting the code into something you'd be able to use (I don't know if the code works btw, I'm just trusting weirdan ;))


<a href="javascript://" onclick="top.location.href=top.frames[1].location.href;">Remove frames</a>

hoodymahood
05-14-2003, 07:50 PM
it works but removes the left frame not the right what needs changing to fix that?

its uploaded here for you

http://www.flackwellheathcc.co.uk

hope you can help..

shlagish
05-14-2003, 10:22 PM
<a href="java script://" onclick="top.location.href=top.frames[1].location.href;">Remove frames</a>

Should become:

<a href="java script://" onclick="top.location.href=top.frames[2].location.href;">Remove frames</a>

That makes the 2nd frame go away :)

hoodymahood
05-15-2003, 05:53 PM
thank you very much please excuse the lack of knowledge have been out ofthe scene fopr about 6 months.

and i love you use of colour makesit very clear!!!! :)