Wednesday, February 18, 2009

How to check user has disabled Javascript ?

This is a samble example to check the Javascript is disabled or not

< html>
< head>
< title>Testing< /title>
< /head>
< script language='javascript'>
function testJava()
{
alert("Hello good idea to enable scripting");
}
< /script>
< noscript>
< ?php
echo "PLEASE ENABLE JAVASCRIPT BEFORE PROCEEDING.";
?>
< /noscript>
< body onLoad='testJava();'>
< /body>
< ?php
echo "Yahoo... Javascript is enabled";
?>
< /html>

No comments: