ASP.NET MVC 4: cannot modify jQuery Unobtrusive Ajax

后端 未结 2 858
花落未央
花落未央 2021-02-07 13:12

Using ASP.NET MVC 4 and NuGet to manage packages.

After upgrading to jQuery 1.9.1 via NuGet, I began getting Ja

2条回答
  •  北荒
    北荒 (楼主)
    2021-02-07 13:41

    live() has been removed in jQuery 1.9 along with a few other features.

    If you need to have support for removed features you need to also add the jQuery migrate file which contains the removed features.

    Adding the reference similar to below should include all the features you need:

    
    

    The migrate file in debug mode will also add warnings to your console notifying you when you use any removed features. This will help you in slowly replacing them as you go along leading to eventually you being able to remove the migrate file reference, using only jQuery 1.9 and beyond.

    See the following jQuery blog posts for all the details on migrating to jQuery 1.9.

    • jQuery Core 1.9 Upgrade Guide
    • jQuery 1.9 and 2.0 — TL;DR Edition
    • jQuery 1.9.1 Released
    • jQuery Migrate 1.1.1 Released
    • Migrate on GitHub: Migrate older jQuery code to jQuery 1.9+

提交回复
热议问题