I have a website, where I am trying to use Ajax to update some stuff on the page without reloading it. However, there is a good chance that many of my users will be using mo
Just remove the meta tag with javascript:
<meta http-equiv="refresh" content="2;http://new-url/" id="meta-refresh">
<script type="text/javascript">
var mr = document.getElementById("meta-refresh");
mr.parentNode.removeChild(mr);
</script>
I've set the refresh timeout to 2 seconds above just as an example. You could probably get away with 1 second as well, but don't set it to 0 because the javascript won't get a chance to execute in that case. 0 is also annoying because it breaks back-button usability.
Edit 2012-10-23 This does not appear to work any more. The node still gets removed, but it appears that browsers parse and hold in memory all meta tags any way.
I've found that the noscript tag works quite nicely for this. For example, you can place this just after you close the head element:
<noscript>
<meta http-equiv="refresh" content="5;URL=http://www.example.com">
</noscript>
No need to remove the meta tag with script, since a browser that has script support will ignore everything inside the noscript element.