Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to reload an iframe in NN6.2

Status
Not open for further replies.

2ni

Programmer
Mar 21, 2002
36
FR
i have an iframe and a button in my web page, my button call a function which reload the iframe. This work fine in ie but i don't know how to do in Netscape 6 ?

My script :

var ie = document.all ? 1 : 0;
var ns6 = document.getElementById && !document.all ? 1 : 0;

function fRefresh()
{
if (ie)
document.frames["INCIDENTS"].location.href = "incidents.asp";
else if (ns6)
alert(document["INCIDENTS"]);

}

My HTML Code :

<input type=button value=&quot;Rafraîchir&quot; class=bouton OnClick=&quot;fRefresh()&quot;>
<br><br>
<iframe id=&quot;INCIDENTS&quot; src=&quot;incidents.asp&quot; noresize frameborder=&quot;1&quot; framespacing=&quot;0&quot; noresize width=&quot;660&quot; height=&quot;300&quot; scrolling=&quot;yes&quot;></iframe>
 
Why did you remove 'frames' from frame referencing? It should be the same for both IE and N6.
 
document.frames doesn't work but this work in NN 6.2 :

document.getElementById(&quot;INCIDENTS&quot;).src = &quot;incident.asp&quot;;
 
OK, the error is that [tt]frames[/tt] array is not a child of the [tt]document[/tt] object, but of the the [tt]window[/tt] object.
Of course, IE doesn't care about right syntax and allows you to refer to frames as you did.

Here is how to refer to another frame:
[tt]
parent.INCIDENTS.location.href = url;
[/tt]
if you want to change a frame in another window, this is how to do it:
[tt]
windowName.frameName.location.href = url;
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top