Meta Refresh Bug in IE7?

Ever since I upgraded my browser to IE7, I noticed that a few websites no longer worked properly. After some research, it seemed that this was caused by IE7 not interpreting the <META HTTP-EQUIV="Refresh" …/> flag correctly.

To prove my point, try accessing the following two websites with IE7, http://www.zipzoomfly.com (a computer hardware online store) and http://www.vanguard.com (an investment firm). Instead of displaying their homepages, you will get nothing back (white screens, no errors).

An analysis of the responses from both urls revealed that both sites use the <meta http-equiv=”refresh”…/> tag, as shown below:

zipzoomfly.com

<html>

<head>

<meta http-equiv="REFRESH" content="0.1; url=http://www.ZipZoomFly.com/jsp/Home.jsp">

<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />

<title>ZipZoomFly</title>

</head>

<body>

</body>

</html>

vanguard.com

<html>

<head>

<META HTTP-EQUIV="Refresh" CONTENT="0; URL=/VGApp/hnw/CorporatePortal">

</head>

</html>

It appears that the javascript redirect works fine with IE7 given that you have a javascript enabled browser (most users have this setting). Apple’s store used both techniques and its website works under IE7. Here is the http response from http://store.apple.com:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

<HTML>

<HEAD>

<TITLE></TITLE>

<META HTTP-EQUIV=REFRESH CONTENT="1; URL=http://store.apple.com/1-800-MY-APPLE/WebObjects/AppleStore.woa">

<SCRIPT LANGUAGE="JavaScript">

<!–

function time() {

setTimeout("window.location.replace(‘http://store.apple.com/1-800-MY-APPLE/WebObjects/AppleStore.woa’)",10)

}

–>

</SCRIPT>

</HEAD>

<BODY onLoad="time()">

</BODY>

</HTML>

So, as a best approach, use both techniques if you have to automatically redirect the user to some other pages upon requesting the default page.

 

Update: It seems that IE7 does support Meta Refresh tag, but the setting is buried. See my latest post for more information.

Be Sociable, Share!

3 Comments

  1. Marc says:

    The JavaScript method does not work if you have a query string after the url. The page reloads and breaks, in my experience.

    Our site uses the META refresh with a url with a query string to update a page from a db. The page updates fine in Firefox but fails to reload in IE, even though meta refresh is enabled in the security settings of IE. If I remove the query string from the meta entry the page refreshes in IE but with no point since it no longer has the query string to update the page with new information.

    Any idea on how to make meta refresh work in IE with a query string?

  2. Sean says:

    Even better would be to use 301/302 header redirects — more search engine friendly and doesn’t matter what browser you have.

  3. Gorilla Grams says:

    Even BETTER would be if IE still allowed meta refresh. There are all kinds of work arounds, so I don’t see a whole lot of value in them coding around meta refresh. However, this is IE we’re talking about here, so it’s no surprise that it includes extremely stupid features while totally ignoring others (better understanding of CSS positioning for instance)

    Thanks for the info though, I thought I was going crazy.

    MGG

Leave a Reply