Posted By: Arowin | Aug 8th, 2006 @ 4:25 PM
page 1 of 1
Comments: 4 | Views: 4963

Hi all,

I'm sorry about the seemingly simple question, but I can't for the life of me (and three other people I've asked here at work) what the problem is....

Here's my basic test HTML page (test.html):

<html>
  <head>
    <meta http-equiv="Refresh" content="5;url=test.html">
      <script>
        var cur = 5;
        function start() {
          cur--;
          window.setTimeout("start();", 1000);
          document.getElementById("test").innerHTML = cur;
       }
      </script>
    </head>
    <body onload="start();"><span id="test"></span></body>
</html>


As you can see, it's got a basic countdown that gets displayed on the page and the page should refresh after 5 seconds (To another page - just in this case it's the same page).

What my question has to with is the META tag.

The refresh works fine in Firefox. I can see nothing wrong with the code, but the refresh does nothing when I try it in Internet Explorer...

Is there something I'm doing wrong that's blatantly obvious? Is it just me? Smiley

CannotResolveSymbol
CannotResolveSymbol
Microsoft: Who do you want to execute today?
Works fine here on IE6 and 7 Beta3.  Only thing I can think of is a security setting stopping it (Meta refresh is disabled if you have the zone's security setting set to high):

Image Hosted by ImageShack.us

My file used to test:

Relative hyperlink in redirect:  MetaRefreshRelative.html

Absolute hyperlink in redirect:  MetaRefresh.html
By the way, if you aren't changing the URL when you refresh, you dont need the url= in the content attribute of the meta tag.
Matthew van Eerde
Matthew van Eerde
AKA Maurits
Be aware that the HTTP Refresh header is non-standard.
Matthew van Eerde wrote:
Be aware that the HTTP Refresh header is non-standard.


You don't need META-Refresh in JS enabled Browsers.

Not a web guy, so I dunno what the difference really is...
If someone could enlighten me, well that would be peachy.

<html>
  <head>
    <!-- meta http-equiv="Refresh" content="5;url=test.html" -->
      <script>
        var cur = 5;
        var URL = "test.html"
        function start() {
          cur--;
          window.setTimeout("start();", 1000);
          document.getElementById("test").innerHTML = cur;
          if(cur == 0) {
           window.location.href = URL;
          }
       }
      </script>
    </head>
    <body onload="start();"><span id="test"></span></body>
</html>

page 1 of 1
Comments: 4 | Views: 4963
Microsoft Communities