[Javascript] IE 11 브라우저 체크

2014. 10. 16. 14:54프로그래밍/Javascript & JQuery

- IE11 에서 navigator.appName을 하면 Nescape가 return 된다. 때문에 몇가지 조건을 걸어줘야  IE를 체크할수있다.


navigator.appName == 'Microsoft Internet Explorer') || ((navigator.appName == 'Netscape') &&

 (new RegExp("Trident/.*rv:([0-9]{1,}[\.0-9]{0,})").exec(navigator.userAgent) != null))


True 혹은 False 리턴.