Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Alternative to http meta refresh

Reply
Thread Tools

Alternative to http meta refresh

 
 
Jarson
Guest
Posts: n/a
 
      08-12-2004
My webserver hosts some on-line reports with live data. I have put an html
meta tag to force the client to refresh every 10 minutes so my clients will
always show the latest data ..

<meta http-equiv="Refresh" content="600" />

However, once or twice every day my IP address changes or my WAN link may be
inaccessible for a couple of minutes. If the client refresh occurs during
the period that my host is down or DNS entry is updating then the refresh
will result in an error.

Is there a way to replace this will a small Javascript in each page to first
check if my site is available, and only then refresh the page? I'm just
learning JavaScript, so any code tidbits would be greatly appreciated.

Jarson


 
Reply With Quote
 
 
 
 
Randy Webb
Guest
Posts: n/a
 
      08-12-2004
Jarson wrote:

> My webserver hosts some on-line reports with live data. I have put an html
> meta tag to force the client to refresh every 10 minutes so my clients will
> always show the latest data ..
>
> <meta http-equiv="Refresh" content="600" />


In IE6
Tools>Internet Options>Security Tab, Custom Level.
Uncheck the "Allow Meta Refreshes"

My point is that Meta Refreshes are as simple to disable as javascript is.

> However, once or twice every day my IP address changes or my WAN link may be
> inaccessible for a couple of minutes. If the client refresh occurs during
> the period that my host is down or DNS entry is updating then the refresh
> will result in an error.


> Is there a way to replace this will a small Javascript in each page to first
> check if my site is available, and only then refresh the page? I'm just
> learning JavaScript, so any code tidbits would be greatly appreciated.


Try loading an image from your server, check its onError and onLoad to
see if it loads. If it doesn't load, try it with the second server.
Search the archives for ways to accomplish that.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
 
Reply With Quote
 
 
 
 
Robert
Guest
Posts: n/a
 
      08-13-2004
> Try loading an image from your server, check its onError and onLoad to
> see if it loads. If it doesn't load, try it with the second server.
> Search the archives for ways to accomplish that.


This will let you know the server is around.

To get data, one possibility is to use a hidden iframe. What you do
is periodically load the iframe. Have the iframe invoke some
javascript in the onload handler. Have the javascript refresh the
page.

Here is a more detail write up:

http://groups.google.com/groups?hl=e...news.xs4all.nl

From: Erwin Moller
Subject: Re: calling Perl script from javascript
Newsgroups: comp.lang.javascript

Another alternative is to use an xml HTTP request. See:

http://jibbering.com/2002/4/httprequest.html

I'd try to find a week long course on advanced web programming that
covers this stuff and convince your boss you need to attend.


Robert
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
META HTTP-EQUIV="REFRESH" & IsPostBack chortler@fetchmail.co.uk ASP .Net 5 05-11-2005 12:33 PM
Resetting Timer on <meta http-equiv="refresh" George Durzi ASP .Net 3 04-28-2005 03:13 AM
META HTTP-EQUIV="Refresh" problem on mobile aspx page Chumley Walrus ASP .Net 1 03-05-2005 10:43 AM
META HTTP-EQUIV="Refresh" =?Utf-8?B?bWc=?= ASP .Net 3 06-30-2004 07:56 PM
META NAME and META HTTP-EQUIV Nym Pseudo HTML 1 09-26-2003 09:13 AM



Advertisments