Using ASP.NET MVC 4
and NuGet
to manage packages.
After upgrading to jQuery 1.9.1
via NuGet
, I began getting JavaScript
errors regarding the removal of the live()
function in jQuery 1.9.x
.
I hit F5 to run in debugging mode from VS.NET, go to the login page, and get the following:
Found this StackOverflow answer: https://stackoverflow.com/a/14512797 and made the 4 changes to ~\Scripts\jquery.unobtrusive-ajax.js
.
My ~\Scripts\jquery.unobtrusive-ajax.js
:
$(document).on("click", "a[data-ajax=true]", function (evt) {
...
});
$(document).on("click", "form[data-ajax=true] input[type=image]", function (evt) {
...
});
$(document).on("click", "form[data-ajax=true] :submit", function (evt) {
...
});
$(document).on("submit", "form[data-ajax=true]", function (evt) {
...
});
I also physically deleted jquery.unobtrusive-ajax.min.js
and used WebGrease 1.3.0
to regenerate it from my updated ~\Scripts\jquery.unobtrusive-ajax.js
.
However, for some reason, my changes to not use the .live()
function are not sticking. I tried stopping the IIS Express 8.0 Web Site (localhost:63798) under which VS.NET is running the MVC App.
Also tried doing a Build->Clean Solution, Build->Rebuild Solution before hitting F5 to run in debug mode again.
If anyone has experienced this before and has any insight, I would be very grateful. Thank you in advance.
/Scripts/jquery-1.9.1.js
,/Scripts/jquery.unobtrusive-ajax.js
,/Scripts/jquery.validate.js
,/Scripts/jquery.validate.unobtrusive.js
– Epicycle