Mes notes

2 janvier 2007

Detection du navigateur en Javascript

Enregistré dans : Non classé — benoit.guillon @ 10:46
if((navigator && navigator.appVersion.indexOf("X11")!=-1)
|| (window.clientInformation && window.clientInformation.appVersion.indexOf("Linux")!=-1))
__CSS_BROWSER__ = "IS_LINUX";
if(navigator && navigator.appVersion.indexOf("Mac")!=-1)
__CSS_BROWSER__ = "IS_MAC";
if(window.clientInformation && window.clientInformation.appName=="Konqueror")
__CSS_NAVIGATOR__ = "IS_KONQUEROR"
else if(window.clientInformation && window.clientInformation.appVersion.indexOf("Safari")>-1)
__CSS_NAVIGATOR__ = "IS_SAFARI";
else if(navigator.userAgent.toLowerCase().indexOf("opera") != -1)
__CSS_NAVIGATOR__ = "IS_OPERA";
else if(document.all) __CSS_NAVIGATOR__ = "IS_IE";
else if (document.layers)__CSS_NAVIGATOR__ = "IS_NS";
	

Propulsé par WordPress