You are here: irt.org | FAQ | JavaScript | General | Q44 [ previous next ]
By using the following it is possible to redirect browsers that don't support JavaScript to one page and browsers that do to another:
<html> <head> <meta http-equiv="Refresh" content="1;URL=http://www.somewhere.com/js-no.html"> <script language="JavaScript"><!-- if (document.images) window.location.replace("http://www.somewhere.com/js-yes.html"); else window.location.href = "http://www.somewhere.com/js-yes.html"; //--></SCRIPT> </head> </html>
Note: in Opera replace() will work, but only with absolute URL's.
The following was suggested by Tim Antonsen:
Rather than the code you suggest, I've found the following to work quite well:
<html> <head> <noscript> <meta http-equiv="refresh" content="0;URL=http://www.somewhere.com/js-no.html"> </noscript> </head> ....