View Full Version : iFrame refresh problem

12-18-2002, 11:51 PM
hints have been given -- but with no results sofar.
problem : only iFrame not complete window refresh

below the code for the 2 files. Another thing is that the var id_iframe is not defined in src_iframe.htm (NS console reporting).
When you shrink your IE browser so that scrollbars appear - clicking the button will refresh the whole window + scroll action. How to avoid this ??? NS is not scrolling but didn't recognize the id_iframe var.

Tx -- happy year ending to all


<body background="bg.jpg">
<p>Problem iFrame refresh</p>
<div align="center">
<IFRAME name="name_iframe" id="id_iframe" src="src_iframe.htm" scrolling="no" width="550" height="410" frameborder="0">


<body background="bg.jpg">
<a href="#"><IMG name=image border=0 src = "button.gif" onclick=" document.frames[id_iframe].location.reload();" ></a>

12-19-2002, 02:28 AM
why not just:


since you are already inside the iframe and want to reload itself.

12-19-2002, 03:12 AM
tx ,

but it didn't solve the scrolling issue

make your IE window so that scrollbars appear on the right side and you will see.

12-19-2002, 03:32 AM


that's another trick to reload the page :D

12-19-2002, 03:55 AM
i tried your last trick but i'm still scrolling in IE
another thing that I discovered

the parent page is refreshing but not reloading. I placed an animated gif on the main page and when i click on the reloadbutton in the iFrame the iFrame is reloaded and the parent page is refreshed - the animated continued its loop and didn't start from scratch.

its boogoy - Tx

12-19-2002, 04:01 AM
what do you exactly mean by scrolling? Do you mean when you click the reload button in the iframe, the page is refreshed then it will scroll down to its previous position before resfreshing?

and what do you mean by this, "the parent page is refreshing but not reloading"?

12-19-2002, 04:21 AM
example : animated gif - pictures counting from 1 to 10 -- cfr intro from old movies

place this gif in the iFrame (src_iframe.htm) and on the parent page (iFrame.htm).

when the animated gif reaches the 5 click reload button in iFrame (use location.reload().)

The animated gif on the parent page continues its loop: displays 6 en further; the animated gif in the iFrame page starts from 1 again.

the problem of the scrolling is that it will scroll up and not too the previous position before resfreshing -- actually i dont want it to scroll at all.

watch out location.replace(location.href) is a refresh function and not a reload function

Tx 100times
i send a postcard for the solution

12-19-2002, 04:31 AM
i thought you want to scroll to the top :D

ok, try:

<a href="#" onclick="location.reload();return false;" ><IMG name=image border="0" src="button.gif" /></a>

if that doesn't work, then try this:

<a name="reload"></a>
<a href="#" onclick="location.replace(location.href+'#reload');return false;" ><IMG name=image border="0" src="button.gif" /></a>

Can you differentiate refresh and reload because they are the same.

12-19-2002, 04:54 AM
sorry it didn't work
all files attached of my iFrame refresh problem project
Tx --

12-19-2002, 05:03 AM
this works for me:

<a href="#" onclick="location.reload();return false;" ><IMG name=image border="0" src="button.gif" /></a>

it reloads the iframe and not the main page. is this what you want? Im confused on what you need :(

if you want the main page to refresh, then try:

<a href="#" onclick="top.location.reload();return false;" ><IMG name=image border="0" src="button.gif" /></a>