Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
586 views
in Technique[技术] by (71.8m points)

javascript - 未捕获的TypeError:无法读取未定义的属性'msie' - jQuery工具(Uncaught TypeError: Cannot read property 'msie' of undefined - jQuery tools)

I am getting the following error in Chrome dev console:(我在Chrome开发者控制台中收到以下错误:)

Uncaught TypeError: Cannot read property 'msie' of undefined My understanding is that it is because .browser is now deprecated in jQuery however I am using the latest version of jQuery tools and it is still giving the error, I checked in the js file and it is there.(我的理解是因为.browser现在在jQuery中被弃用了但是我使用的是最新版本的jQuery工具,它仍然给出错误,我检查了js文件,它就在那里。) How can I get around this so it does not give the error?(我怎么能解决这个问题呢?它不会给出错误?)   ask by Colin747 translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You can check out this solution by AJ.(您可以通过AJ查看此解决方案。)

It's pretty straightforward, just copy and paste the following lines of code.(它非常简单,只需复制并粘贴以下代码行即可。) 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; } })(); Reference :(参考 :) $.browser on jQuery 1.9.x for legacy IE detection(用于传统IE检测的jQuery 1.9.x上的$ .browser)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...