I have just updated jQuery & jQuery UI to: jquery-1.9.0.min.js and jquery-ui-1.9.2.min.js
And... all my unobtrusive Ajax calls (Ajax.ActionLink, Ajax.BeginForm) stopped working properly - they open results in a new page instead of updating the existing div.
And I get this javascript error in Firebug when my page loads:
Code hasn't changed of course, just updated the jQuery scripts using Nuget.
Anyone experienced the same problem ??
Update: This issue has been fixed in the latest NuGet package. I've posted another answer to reflect this. https://stackoverflow.com/a/15539422/714309
In jquery.unobtrusive-ajax.js
, find and replace these four lines:
$("a[data-ajax=true]").live("click", function (evt) {
$(document).on("click", "a[data-ajax=true]", function (evt) {
$("form[data-ajax=true] input[type=image]").live("click", function (evt) {
$(document).on("click", "form[data-ajax=true] input[type=image]", function (evt) {
$("form[data-ajax=true] :submit").live("click", function (evt) {
$(document).on("click", "form[data-ajax=true] :submit", function (evt) {
$("form[data-ajax=true]").live("submit", function (evt) {
$(document).on("submit", "form[data-ajax=true]", function (evt) {
You can also generate a new jquery.unobtrusive-ajax.min.js
using WebGrease.
From the Command Prompt, change to your solution folder and enter this command (assuming your project folder is called Web
):
packages\WebGrease.1.3.0\tools\WG.exe -m -in:Web\Scripts\jquery.unobtrusive-ajax.js -out:Web\Scripts\jquery.unobtrusive-ajax.min.js