今天在做angular的项目的时候,因为需要用到ui-select2所以引入了bootstrap.js,然后bootstrap.js需要jquery1.9版本以上,于是索性换了个2版本的,结果之前的dialog失效不说,还出现Cannot read property 'msie' of undefined的报错,于是在网上查了一下原因,大概是升级到jq2版本的兼容性问题,解决办法一共两种:

  (1)在新版本的jquery后面引入jQuery Migrate js;

<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.js"></script>

(2)在引入jquery后面引入jquery ui前面加上这样一段代码:
jQuery.browser={};(function(){jQuery.browser.msie=false; jQuery.browser.version=0;if(navigator.userAgent.match(/MSIE ([0-9]+)./)){ jQuery.browser.msie=true;jQuery.browser.version=RegExp.$1;}})();
详情请参考:http://blchen.com/jquery-can-not-read-property-msie-of-the-undefined-error-solution/