1

I've done all the steps as described in this post:

Unobtrusive Ajax stopped working after update jQuery to 1.9.0

and this one:

jquery.unobtrusive-ajax plugin broken when updating to Jquery 1.9.0

However I still get a warning in firebug at this line in (jquery.validate.unobtrusive.js)

 $jQval.unobtrusive.parse(document);

enter image description here

1
  • and the validation is not firing? Commented Apr 24, 2013 at 6:00

2 Answers 2

2

got it working without any issues now. Please let me know if this is incorrect but from what I'm seeing it's working fine.

jquery.validate.unobtrusive.js

Line 209 from this:

        var $forms = $(selector)
            .parents("form")
            .andSelf()
            .add($(selector).find("form"))
            .filter("form");

Line 209 to this:

        var $forms = $(selector)
            .parents("form")
            .addBack()
            .add($(selector).find("form"))
            .filter("form");

Line 43:

replace = container.attr("data-valmsg-replace") && $.parseJSON(container.attr("data-valmsg-replace")) !== false;

Line 73:

replace = container.attr("data-valmsg-replace") && $.parseJSON(container.attr("data-valmsg-replace"));
Sign up to request clarification or add additional context in comments.

Comments

1

Your solution is not incorrect, and your fix does the job, but I think a little background information on it would not hurt.

Note that what causes the warning is the jQuery Migrate plugin.

It is for providing backward compatibility for code depending on older jQuery versions. If you do not want to be warned about deprecated features and how to update them to the current standard, you can disable the warnings with the following line of code:

jQuery.migrateMute = true;

Note that these warnings only happen with the development version of jQuery Migrate, so if you switch to the minified version of jquery migrate (jquery-migrate-1.0.0.min.js) this line is not even required.

Also note that you are using the development versions of the jquery files, in a production environment you should use the minified versions, so your fix would need to be also implemented in jquery.validate.unobtrusive.min.js.

So all in all:

  • You do not need to fix it, if you use the jQuery Migrate plugin (which you do).
  • That warning can be disabled.
  • That warning will not show up in a production environment (if the correct scripts are used).
  • Microsoft will hopefully fix it anyway in the next version of jquery.validate.unobtrusive
  • If you DO fix it, make sure you also fix it in the minified version.
  • The only benefit of fixing it will be that you can drop the jQuery Migrate plugin (which I only recommend if you are absolutely sure that there is no javascript in your app depending on legacy jQuery features).

2 Comments

the thing is that I do not wish to use migrate plugin if not necessary. thanks
Than your fix is fine :). Just make sure you also fix this in the minified version of jquery.validate.unobtrusive.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.