问题描述
因此,Jquery最近发布了第2版,该版本停止了对旧版浏览器的支持.精简版并具有自定义版本,与96 kb版本1.9相比,它更快,更小(40kb).问题是它不支持较旧的浏览器,因此我被迫使用条件注释,仅在ie8及以下版本中包含1.9.但是,由于我页面上的现代浏览器也需要jquery 2.2,因此如何防止旧版本的IE忽略它?
So recently Jquery released version 2 which stopped supporting older browsers. Minified and with a custom build it is much more faster and smaller (40kb) as opposed to 96 kb version 1.9. The issue is that it doesnt support older browsers so I am forced to use conditional comments to include 1.9 for only ie8 and below. However, as I also need jquery 2.2 for the modern browsers on my page, how do I prevent old ie versions to ignore it?
预先感谢
推荐答案
您可以在jQuery网站上找到答案:
You can find the answer on the jQuery website here: http://blog.jquery.com/2013/03/01/jquery-2-0-beta-2-released/
将条件注释用作:
<!--[if lt IE 9]>
<script src="jquery-1.xjs"></script>
<![endif]-->
<!--[if gte IE 9]><!-->
<script src="jquery-2.x.js"></script>
<!--<![endif]-->
这篇关于可以将Jquery 2.2用于现代浏览器,将1.9用于较旧的浏览器,以进行后备吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!