Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q44 How do I redirect browsers that do not support JavaScript?

irt.org | Knowledge Base | JavaScript | General | Q44 [ previous next ]

Q44 How do I redirect browsers that do not support JavaScript?

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>
....

Feedback on 'Q44 How do I redirect browsers that do not support JavaScript?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.