You are here: irt.org | FAQ | JavaScript | Redirect | Q921 [ previous next ]
Don't create the looping feature in the first place. Instead of doing:
<script language="JavaScript"><!-- location.href = 'nextpage.htm'; //--></script> <noscript> Your browser does not support JavaScript, or JavaScript is disabled. </noscript> |
Use:
<script language="JavaScript"><!--
if (document.images)
location.replace('http://www.somewhere.com/nextpage.htm');
else
location.href = 'nextpage.htm';
//--></script>
<noscript>
Your browser does not support JavaScript, or JavaScript is disabled.
</noscript> |
Feedback on 'Q921 When using a simple redirect script for javascript enabled browsers, how can I stop the browser redirecting when the user presses the back button to back out of my site?'