473,320 Members | 1,900 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Alternative to http meta refresh

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
Jul 23 '05 #1
2 8524
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
Jul 23 '05 #2
> 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
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

43
by: dan baker | last post by:
I have a page that gets loaded with a meta-refresh hardcoded so that a few things on the page get updated. its kind of a fake chat board. anyway, what I need to do is turn off the meta-refresh once...
10
by: Udi Zisser | last post by:
Hello, any idea why this does not work? or how do i get this thing to work? <BASE HREF="http://localhost/thedude/"> <META HTTP-EQUIV="Refresh" CONTENT="0; URL=redirect.html"> I'm adding...
1
by: Chumley Walrus | last post by:
I'm trying to use : <META HTTP-EQUIV="Refresh" CONTENT="180; URL=main.aspx"> to refresh a mobile page (made in vs.net with the MMIT) for a page that I need to refresh every 3 minutes, but I...
3
by: George Durzi | last post by:
I'm using the following tag to refresh my page every 3 minutes. <meta http-equiv="refresh" content="180; URL=default.aspx"> However, it's bound to happen that a user is working on the page, and...
4
by: aaa | last post by:
How can I turn a Meta Refresh Tag on and off?
5
by: chortler | last post by:
When I use the meta tag to refreh my asp webpage, it doesn't change Ispostback to false; It always equals true? Any ideas??
2
by: =?Utf-8?B?UGhpbCBKb2huc29u?= | last post by:
Hello, I have an ASP.NET 2.0 application with the following meta tag to refresh the page after a minute. <meta http-equiv="Refresh" content="60; URL=Default.aspx" /> I need to be able to...
2
by: runway27 | last post by:
i have a registration page which is a self submitting form <form action="<?php echo $_SERVER; ?>" method="POST" id="test2" name="registrationform"> where in a user fill a form, after the data...
41
by: Twayne | last post by:
Hi, How would I go about "forcing" a user from one page to another? I have a very simple random question/answer entrance requirement for an e-mail form. After 3 page views most people are...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.