August 19, 2009

Javascript 16: Math Objects & Browser Informations


This will be rounded to 3 as a whole number. If you put in 3.5, then it will be rounded to 4. If you put


The number will be put into -6. If you put in the parenthesis inside of random, then it will show up a random long digit number.

Browser Information

var test=navigator.appName;
document.write("You are using "+test);

This will show up your Browser's name. If you are using Mozilla, it will say Netscape instead.

document.write("You are using "+navigator.appName);

Now I deleted the variable and used the Javascript object. naviagator.appName
This will result the same way. Even if you change the object name to navigator.appName to naviagator.platform, then it will show up your platform name, most likely Win32.

document.write("You are using "+navigator.platform);

, , , , ,

Powered by ScribeFire.

No comments:

Post a Comment