if condition: if the browser is IE and IE browser version is older than 9

前端 未结 9 1142
时光说笑
时光说笑 2020-12-24 09:17

The if condition below I think it says - if the browser is IE and IE browser version is newer than 9, but I don\'t have IE 9 to test it so it is hard to know the correct out

9条回答
  •  天涯浪人
    2020-12-24 09:44

    Instead of putting in a bunch of inline javascript you could just add an empty div for the version of ie you are targeting, so put the following at the top of your html, just inside the body tag:

    
    

    Then you can place an if statement in your jquery to check for that block.

    if ($("#iedetect").is(".oldie")) {
        //Do something
    } else {
       //Do Something else in all other browsers
    }
    

提交回复
热议问题