/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
isMac = (navigator.appVersion.indexOf(â€Macâ€)!=-1) ? true : false; NS4 = (document.layers) ? true : false; IEmac = ((document.all)&&(isMac)) ? true : false; IE4plus = (document.all) ? true : false; IE4 = ((document.all)&&(navigator.appVersion.indexOf(â€MSIE 4.â€)!=-1)) ? true : false; IE5 = ((document.all)&&(navigator.appVersion.indexOf(â€MSIE 5.â€)!=-1)) ? true : false; IE6 = ((document.all)&&(navigator.appVersion.indexOf(â€MSIE 6.â€)!=-1)) ? true : false; IE7 = ((document.all)&&(navigator.appVersion.indexOf(â€MSIE 7.â€)!=-1)) ? true : false; ver4 = (NS4 || IE4plus) ? true : false; NS6 = (!document.layers) && (navigator.userAgent.indexOf(’Netscape’)!=-1)?true:false; /* * We can also use */ # if (typeof document.body.style.maxHeight != "undefined") { # // IE 7, mozilla, safari, opera 9 # } else { # // IE6, older browsers # } //or if (window.XMLHttpRequest) { // IE 7, mozilla, safari, opera 9 } else { // IE6, older browsers }