I want a code snippet (a specific function) to run only when the browser is IE 10 and 11, when it is Firefox or Chrome for example, I want this function to be ignored. Is this possible?
I want a code snippet (a specific function) to run only when the browser is IE 10 and 11, when it is Firefox or Chrome for example, I want this function to be ignored. Is this possible?
I would not do this, read this , but if you really want it (it will not work on Edge too):
if (/MSIE \d|Trident.*rv:/.test(navigator.userAgent)) {
funcao()
}
I placed GitHub for future reference.