I created a new ASP.NET MVC 4.0 project that was basic and didn't include jQuery or other scripts that the Intranet and Internet templates insert by default. I then went to add the scripts using NuGet and installed the latest version of all the jQuery and related files that are normally installed by the MVC Intranet and Internet templates.
When I tried running the application I started to receive errors. Apparently there are incompatibilities with the libraries/extensions that were written previous to jQuery 1.9. It seemed like after fixing an issue I'd run into another. I finally gave up and copied the versions of the js files that would have installed. This resolved the issues I was able to use features such as remote validation.
Since I'm new to ASP.MVC, I'd like to know what the Best Practice is related to jQuery updates. I assume I need to wait until all the libraries/extensions have caught up, but I would need to follow the status of each library/extension to determine when I could upgrade.
jQuery deprecated the .live()
method in v1.9. It can be replaced with .on()
. This broke jquery.unobtrusive-ajax.js. I know from experience when cursing the update that I first pulled from NuGet.
There is an update to jquery.validate out there, also mentioned in this thread. But I have not validated it yet, jquery 1.9.1 is available as well.
For your questions...
I think it is good practice to keep your packages upto date, but also research any deprecated functionality. Also using some source save like tools is a good idea. You could easily revert any breaking changes with one or two mouse clicks.
Even though there is not a \packages folder added to you virgin project (intra or internet). If you open up the NuGet package manager UI, updates will still show up.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With