Skip to content

Blog

IE meta refresh issue and solution

Author: James Brown

Recently we ran across an issue with Internet Explorer 7 and 8. It was only refreshing a page using the meta refresh tag once, when we wanted to refresh the page multiple times. Below is an example of the code we were using.

<meta http-equiv="refresh" content="5" />

This refreshes the current page after 5 seconds. The problem we had was we were refreshing this page a number of times, until a specific condition was true and then the system would move on. Internet Explorer was having problems with this, it would refresh the page once and then stop. We now believe this is a bug to do with IE where it refuses to refresh the same page more than once.

How we got around this issue was through the use of a query string appended to the end of the URL, this would mean the page would remain the same but because the URL was different IE would think it was refreshing a different page every time. To create this unique query string we simply added the current time to the query.

Our final solution can be found below:

<meta http-equiv="refresh" content="5;url=stage.php&stage=2&Bit=<?php print date('his'); ?>" />