问题
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