Although this is the answer to the original question, this is NOT what you should do. So donβt do it!
Why not work out which browser you use and save it in a variable in javascript. Then you can have if statemenets and the like in your javascript. For example, if I am IE, then do it, otherwise do it. You get the idea!
Did you see that? Browser charge
Significant Bit:
var is = { ff: window.globalStorage, ie: document.all && !window.opera, ie6: !window.XMLHttpRequest, ie7: document.all && window.XMLHttpRequest && !XDomainRequest && !window.opera, ie8: document.documentMode==8, opera: Boolean(window.opera), chrome: Boolean(window.chrome), safari: window.getComputedStyle && !window.globalStorage && !window.opera }
Tom chantler
source share