File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes refresh/reload Netscape Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "refresh/reload Netscape" Watch "refresh/reload Netscape" New topic
Author

refresh/reload Netscape

Saeed Yaz
Greenhorn

Joined: Oct 31, 2001
Posts: 7
I'm having a problem with the reloading of my page in Netscape. I have a frame that needs to be reloaded every minute. I was able to use a meta tag to do this but in Netscape the frame fails to reload and the info in the frame fails to update. The only way I can update the frame is by holding down the shift key while I reload the frame. Is there a way I can simulate the holding down of the shift key while the page reloads? I�ve tried writing applets, and scripts, and I�ve used meta tags which reloads/refreshes every minute. It works great in IE but in Netscape no luck .
Help!! Running out of ideas���..
Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2581

Have you tried this?

This is what it does - you create a new url every time by appending it a random value in a query string, which means the browser thinks of this as a new URL and fetches it from the server, rather than from the cache. On the server side however, you do not need to take care of this parmeter of the querystring. Then in onLoad event of body tag, you call this function after 1 minute (60 * 1000 ms). This should work with all (JavaScript enabled) browsers.
Actually meta tag refresh should have worked as well. Did you try using it with "no-cache" tags? Anyway, let me know if this solution works.
HTH,
- Manish
[This message has been edited by Manish Hatwalne (edited October 31, 2001).]
Saeed Yaz
Greenhorn

Joined: Oct 31, 2001
Posts: 7
Manish,
Thank you for the response but unfortunately I'm recieving a javascript error that you might be able to help me out with.
This is the error that I recieve when I run the script:
JavaScript Error:
(new Date()).valuOf is not a function.
This is my html page:
<HTML>
<HEAD>
<noscript>
<meta http-equiv="refresh" content="60">
</noscript>
<script type="text/javascript">
function refreshPage(){
var szURL = "http://www.mydomain.com?rand=" + new Date().valuOf();
self.location.replace(szURL);
}
</script>
</HEAD>
<meta http-equiv="pragma" content="no-cache">
<BODY BGCOLOR="#FFFFFF" onLoad="setTimeout('refreshPage()',60000);">
</BODY>
</HTML>
Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2581

Originally posted by Saeed Yaz:
Manish,
Thank you for the response but unfortunately I'm recieving a javascript error that you might be able to help me out with.
This is the error that I recieve when I run the script:
JavaScript Error:
(new Date()).valuOf is not a function.
use new Date().valueOf() here.
This is my html page:
<HTML>
<HEAD>
<noscript>
<meta http-equiv="refresh" content="60">
</noscript>
<script type="text/javascript">
function refreshPage(){
var szURL = "http://www.mydomain.com?rand=" + new Date().valuOf(); // use valueOf() here
self.location.replace(szURL);
}
</script>
</HEAD>
<meta http-equiv="pragma" content="no-cache">
<BODY BGCOLOR="#FFFFFF" onLoad="setTimeout('refreshPage()',60000);">
</BODY>
</HTML>

Sorry, I had made a typo while posting which I corrected later. Probably you took the previous post code. use valueOf() instead of valuOf(), it should work.
- Manish
Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2581

Just one more thing,
<meta http-equiv="pragma" content="no-cache">
tag should be in the <head> and </head> section of HTML.
- Manish
Saeed Yaz
Greenhorn

Joined: Oct 31, 2001
Posts: 7
Manish,
Thanks for the help, but I'm still getting the same results. The info in that frame just does not update. With the script you gave me it updates once, and grabs the rest from cache. This occurs even withe the <meta> tag cache=0. I'm going to try one more script that I wrote, I'll keep you posted.
~Thanks again............
Saeed Yaz
Greenhorn

Joined: Oct 31, 2001
Posts: 7
Problem Solved.
Thank you for your input...............
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: refresh/reload Netscape