Showing posts with label meta refresh ie7 bug. Show all posts
Showing posts with label meta refresh ie7 bug. Show all posts

Thursday

IE 7 meta refresh bug

This is seriously crazy - the old-school

<meta equiv="Refresh" content="3;url=http://mytest.local">

does not work in IE 7 with default settings because of security settings disabling the meta-refresh.


Solution:

In the HEAD section:


function Refresher(t) {
if(t) refresh = setTimeout("document.location='http://www.mysite.com';", t*1000);
}



And I call the script inside the BODY tag:

<body onload="Refresher(20)">

Where the parameter is the amount of seconds that IE should wait until refresh.

Tip o' the hat to http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=870204&SiteID=1