判斷是否是IE瀏覽器

1、jquery: navigator.userAgent.indexOf("MSIE") >= 0 || (navigator.userAgent.indexOf("Mozilla") >= 0 && navigator.userAgent.indexOf("Chrome") == -1);

      注:IE11的內核標示是Mozilla

2、打印使用console.log("****"+navigator.userAgent);

      谷歌瀏覽器如圖所示:

     

      IE瀏覽器如圖所示: 

     

3、打斷點使用debugger;


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章