Forum Moderators: phranque

Message Too Old, No Replies

window.location.reload() in Netscape

windoe.location.reload() in Netscape

         

bmatth1

9:09 pm on Sep 19, 2003 (gmt 0)

10+ Year Member



Here is the code I am trying to use to go back to a previous page to the location I left off.

function newpage() {
history.go(-2);
window.location.reload();
}

This works fine in IE6, but not in Netscape - it just sits there and looks at me when I click on the button. Here is the calling code:

<a onclick="newpage()" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image41','','../../../Images/Directory_Buttons/Delete_another_down.gif',1)"><img src="../../../Images/Directory_Buttons/Delete_another_up.gif" title="Delete another record" name="Image41" width="208" height="38" border="0" id="Image41"></img></a> <br>

I have tried to use this: window.location.reload(force);, and the page loads correctly, but it is not refreshed - I have to manually refresh to get the current page. Without the word "force", this works fine in IE6.

Any ideas why this will not work correctly in Netscape7?
thank you,
Bob

anchordesk

10:56 pm on Sep 19, 2003 (gmt 0)

10+ Year Member



I use this:

window.location.reload(true)

... and it works with in the sequence of my javascript.

bmatth1

12:49 am on Sep 20, 2003 (gmt 0)

10+ Year Member



Thanks.
I have tried this. It works just fine in IE6. However, I must be doing something wrong in Netscape7,unless it just doesn't recognize it.
Does this work for you in Netscape7?
Thank you for the help,
Bob

anchordesk

2:33 am on Sep 20, 2003 (gmt 0)

10+ Year Member



Yes, Netscape 7.02 reloads for me.

If your server has PHP, copy/paste this into a new php page to your server:

<?php
?>
<HTML>
<HEAD>
<TITLE>reload test</TITLE>
<script language="JavaScript" type="text/javascript">
<!--
function reloadpage() {
window.location.reload(true);
}
// -->
</script>
</HEAD>
<BODY>
<?
$l = 8;
for(;strlen($s)<=$l;$s.=chr(rand($a=ord('A'),ord('Z'))+ rand()%2*(ord('a')-$a)));
echo "New Random Number: $s";
?>
<br>Reload this <a href="javascript:reloadpage()">page</a>.
</BODY>
</HTML>

Access the page; click the reload link. Should work. If you don't do PHP, then just strip that out and save as an html page ... harder to see a relaod, but it's there nonetheless.

bmatth1

10:24 am on Sep 20, 2003 (gmt 0)

10+ Year Member



Maybe it is the history.go(-2) that is not working, or the combination of both?
Thank you,
Bob