使用 jQuery.support = false
因此,我最近想使用 jQuery 进行一些浏览器检测,并注意到从 jQuery 1.3 开始,以前的方法目前已被弃用。
他们现在建议不要测试浏览器,而是测试浏览器的功能。听起来是个好主意,但我不知道如何实际利用这个想法。
$("p").html("This frame uses the W3C box model: <span>" +
jQuery.support.boxModel + "</span>");
这很棒,但是我如何将其包装成:
If jQuery.support.boxModel = false then
有什么想法吗?节日快乐!
So I recently wanted to use the jQuery to do some browser detection and noticed that the previous methods were currently deprecated as of jQuery 1.3.
They now recommend that instead of testing for a browser, test for the features of the browser. Sounds like a good idea, but I cant figure out how to actually utilize this idea.
$("p").html("This frame uses the W3C box model: <span>" +
jQuery.support.boxModel + "</span>");
This is great and all, but how would I wrap that into something that was:
If jQuery.support.boxModel = false then
Any Ideas? Happy Holidays!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)