|
| |
Redirecting Browser to a page if JavaScript support is not there |
If you have developed a page which depends on JavaScript for form validation or for any other purposes then you would be interested in detecting the setting of the client browser and would like to redirect to a different page explaining how to enable or disable JavaScript. Here we will discuss how to check this setting and redirect to a different page accordingly. We can detect this by using noscript tag and if the JavaScript is disabled then the code within this noscript tag will be executed. Here is the code to do that. This code will detect if the script setting is disabled and will redirect to a page explaining how to enable or disable JavaScript with meta refresh in 2 seconds.
<noscript>
<meta http-equiv="refresh"
content="2; URL=enable_javascript.php">
<center>
<table cellpadding="0"
cellspacing="0"
border="0"
width="550">
<tr><td width="100%"
valign="top"
class="PPDesTxt"><b>Are
you using a browser that doesn't support JavaScript?</b></td></tr>
<tr><td width="100%"
valign="top"
class="PPDesTxt">If
your browser does not support JavaScript, you can upgrade to a newer browser,
such as <a href="http://www.microsoft.com/windows/ie/downloads/ie6/default.asp">Microsoft®
Internet Explorer 6</a>
or <a href="http://wp.netscape.com/computing/download/bdp/index.html">Netscape
6</a>.</td></tr>
<tr><td width="100%"
valign="top"
class="PPDesTxt"><b>Have
you disabled JavaScript?</b></td></tr>
<tr><td width="100%"
valign="top"
class="PPDesTxt">If
you have disabled JavaScript, you must re-enable JavaScript to use this page. To
enable JavaScript:</td></tr>
</table>
<table cellpadding="0"
cellspacing="0"
border="0"
width="100%">
<tr><td width="100%"
colspan="2"><img
src="/images/T.gif"
width="1"
height="25"
border="0"></td></tr>
</table></td>
</tr><tr><td>
</noscript>
| |
| Subscribe |
|
Submit your email address and receive
article and product notifications. Your email is safe with us.
|
|
|
|