How to detect IE 11 with javascript in Asp.net

后端 未结 10 1917
暖寄归人
暖寄归人 2020-12-01 05:04

Hello I want to detect the Browser , IE 8 or more will be appropriate for me. For this i used following code but it fails for IE 11 . For other its detecting properly.

10条回答
  •  甜味超标
    2020-12-01 05:28

    More easy and efficient code and detect all versions of IE/Edge:

    if(navigator.appVersion.indexOf("MSIE") != -1 || navigator.appVersion.indexOf("Trident") != -1 || navigator.appVersion.indexOf("Edge") != -1){
    // is IE
    }
    

提交回复
热议问题