Check if user is using IE

后端 未结 30 2107
心在旅途
心在旅途 2020-11-22 04:34

I am calling a function like the one below by click on divs with a certain class.

Is there a way I can check when starting the function if a user is using Internet

30条回答
  •  无人共我
    2020-11-22 05:04

    This only work below IE 11 version.

    var ie_version = parseInt(window.navigator.userAgent.substring(window.navigator.userAgent.indexOf("MSIE ") + 5, window.navigator.userAgent.indexOf(".", window.navigator.userAgent.indexOf("MSIE "))));
    

    console.log("version number",ie_version);

提交回复
热议问题