...

View Full Version : Iframes and reloading them



Tanker
08-20-2002, 07:55 PM
I have the main window, within the main window, I have an iframe (call it iframe0), within iframe0 i have another iframe (call it iframe1), I calling a page in iframe1 to change some stuff on the server then I need to reload just iframe0.

Everything ive tried, parent/top/by name..... , seems to reload the entire page. How can I just make Iframe0 reload without reloading the whole page?

Thanks in advance.

beetle
08-20-2002, 08:05 PM
top.frames['iframe0'].reload();

-or-

parent.parent.reload(); *I think....

Mr J
08-20-2002, 08:25 PM
I had a play with a thought...it didn't hurt really ....
Something like the following should do what you require.

I have attached a zip file with the relative files in so you can see how it works.

Opening the file called "main" will show an Iframe within an Iframe
and the links will load another page to one or the other.


<a href="#null" onclick="document.frame1.location.href='page.htm'">Load into Iframe 1</a>

<a href="#null" onclick="document.frame1.document.frame2.location.href='page.htm'">Load into Iframe 2</a>

Tanker
08-20-2002, 09:12 PM
Thanks for the help. unfortunately neither of those worked. :( Kept getting object not supported errors. :(

I did finally manage to hit on the solution...
top.custWindow.history.go(0);

Thanks again.

beetle
08-20-2002, 09:14 PM
history.go(0) ??

.reload() isn't working?

I thought you were having trouble referencing the iframe, not acutally getting it to refresh?

:confused:

Tanker
08-20-2002, 09:39 PM
was trying to get it to reload/refresh.... I couldn't get reload to work for some reason, but history.go(0) seems to have the same effect.

beetle
08-20-2002, 09:42 PM
Well, yes, it roughly has the same effect.

Maybe
top.custWindow.location.reload();

Mr J
08-21-2002, 07:03 PM
was it for netscape?

Quiet Storm
08-21-2002, 07:48 PM
This is what I use:

Refresh:
[<A HREF="javascript:window.frames.thisi.location.reload();">reload</A>]


thisi being the NAME of the iFRAME.

<IFRAME NAME="thisi" SRC="page.html"></iframe>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum