1.

How to find whether browser supports JavaScript or not

Answer»

The best way to CHECK if a variable exist in JavaScript is to verify it with null.

Let us see an example:

<HTML>    <body>       <SCRIPT>         var a = 4;         if(a != null) {            document.write("Variable do exist!");         }       </script>    </body> </html>

The output: 

Variable do exist!

Above, we worked on the condition that a variable exist if it is not null. Therefore we CHECKED the value if variable a like this:

if(a != null) {    document.write("Variable do exist!"); }


Discussion

No Comment Found