javascript navigator platform

platformNN 4 IE 4 DOM n/a  

Read-only  

Returns the name of the operating system or hardware platform of the browser. For Windows 95/NT, the value is Win32; for a Macintosh running a PowerPC CPU, the value is MacPPC. At least for the major platforms I've been able to test, Navigator and Internet Explorer agree on the returned values. Using this property to determine the baseline facilities of the client in a conditional expression can help the page optimize its output for the device.

 
Example
 
if (navigator.platform == "Win32") {
   document.write("<link rel='stylesheet' type='text/css' href='css/stylePC.css'>");
}
 
Value

String.

 
Default

System dependent.


  • #1
    2009-07-22
    [Quote]
    This also works with other platform's like
    (navigator.platform == "PSP")
    (navigator.platform == "PS3")
    you get the idea : ) hope this help's others
1304,Nickname,Homepage or email,Comments here,Add comment