MVC3 - Update jQuery from 1.5.2 to latest

南楼画角 提交于 2021-01-27 23:01:17

问题


I have a MVC3 project that uses jQuery 1.5.2 and I would like to update to the latest version. I am a bit new to MVC3 and I am wondering about the consequences of updating jQuery? Does anybody have any experience whit this? And how can it be achieved?

Best regards Dep.


回答1:


In general

There are big changes in the jQuery 1.9.x compared to the previous versions. You can check those changes from here. jQuery team did great work and created jQuery Migrate plugin. The idea is that you change your 1.5.2 version to the latest and then also add link to the jQuery Migrate Plugin (after the jQuery).

What the Migration plugin will do is that it checks if you're using deprecated features (like .live) and the plugin works as proxy to the new implementation. You should the check the Developer Toolbar console for messages and make the changes according to the tips.

The jQuery Migration plugin is a temporary solution as it adds overhead and you really should make those changes if you're using deprecated features.

ASP.NET MVC

Depending on what 3rd party libraries you're using (Telerik, DevExpress etc.) you might get some errors if they are use features/API calls that are not supported anymore. Maybe they have newer version that is implemented using current jQuery version.



来源:https://stackoverflow.com/questions/15631784/mvc3-update-jquery-from-1-5-2-to-latest

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!