将jQuery 1.4.2升级到1.9.1 [英] Upgrade jQuery 1.4.2 to 1.9.1

查看:282
本文介绍了将jQuery 1.4.2升级到1.9.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们一直在Web应用程序中使用jQuery 1.4.2.最近建议我们升级到新版本.到目前为止,我们正在考虑升级到1.9.1,因为我们需要支持IE7和IE8. 我们的应用程序使用了一堆插件,例如fancybox,cookies,tipsty,jcarousel等一堆.另外,我们有很多脚本文件,大概有50个文件.然后一些脚本随文件一起嵌入.我觉得这将是一场灾难! 有人有建议吗?我们尚未开始升级到1.9.1.如果需要,我可以说服经理升级到其他版本.我们最安全的选择是什么? 请告知.

We have been using jQuery 1.4.2 in our web application. Recently it was suggested that we upgrade to a newer version. So far we are thinking about upgrading to 1.9.1 as we need to support IE7 and IE8. Our application uses bunch of plugins e.g. fancybox, cookies, tipsy, jcarousel and bunch of others. Plus we have a lot of script files, probably around 50 files. and then some scripts embedded withing the files. I feel like this is going to be a disaster! Does anyone have any advice? We are not set on yet upgrading to 1.9.1. If I want I can convince the managers to upgrade to a different version. What is our safest bet? Please advise.

谢谢!

推荐答案

只看代码中仍然不推荐使用的函数;需要注意的大问题是.live().delegate(),它们已被.on()替换,.attr().prop()替换,而.browser().随着新版本的到来,我一直在更新代码,这非常容易(大约2万行js),因此您应该不会有任何问题.从我提到的功能开始,我认为这将解决大多数问题.然后,查看Migrate插件.

Just look at the deprecated functions still in your code; the big ones to watch out for are .live() and .delegate() which have been replaced with .on(), .attr() for which .prop() is the replacement, and .browser(). I've been updating my code as new versions came along and it's been pretty easy (about 20K lines of js) so you shouldn't have any problems. Just start with the functions I mentioned and I think that'll solve most of the issues. Then, look at the Migrate plugin.

这篇关于将jQuery 1.4.2升级到1.9.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆