Build 2013.1.319 Introduces js issue

Thread is closed for posting
7 posts, 0 answers
  1. Rene
    Rene avatar
    65 posts
    Member since:
    Nov 2010

    Posted 21 Mar 2013 Link to this post

    After just downloading and upgrading to build 2013.1.319 - I now receive the following error when starting my app:

    Microsoft JScript runtime error: Object doesn't support property or method 'live'

    The error occurs in jQuery.unobtrusive-ajax.js (Asp.net mvc):

    $("a[data-ajax=true]").live("click", function (evt) {
            evt.preventDefault();
            asyncRequest(this, {
                url: this.href,
                type: "GET",
                data: []
            });
        });

    p.s. I am using the jquery.min.js that comes with the latest Kendo build.

    Please advise. 
  2. Rene
    Rene avatar
    65 posts
    Member since:
    Nov 2010

    Posted 21 Mar 2013 Link to this post

    the .live is only used 4 places in that jQuery.unobtrusive-ajax.js and does not appear elsewhere.

    I just read the error is due to .live being deprecated in the latest jQuery and that it suggests replacing .live with .on

  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Rene
    Rene avatar
    65 posts
    Member since:
    Nov 2010

    Posted 21 Mar 2013 Link to this post

    http://stackoverflow.com/questions/14357416/asp-net-mvc-4-jquery-validation-script-bundle-not-working
  5. Rene
    Rene avatar
    65 posts
    Member since:
    Nov 2010

    Posted 21 Mar 2013 Link to this post

    Solved by:

    a) using nuget and installing jquery-migrate

    b) including the migrate js in the following bundles (BundleConfig.cs):

    bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                      "~/Scripts/jquery-1.*",
                      "~/Scripts/jquery-migrate-1.*"));

    bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
                      "~/Scripts/jquery.unobtrusive*",
                      "~/Scripts/jquery-migrate-1.*",
                      "~/Scripts/jquery.validate*"));

    Then clean and rebuild the project.
  6. Landon
    Landon avatar
    66 posts
    Member since:
    Nov 2010

    Posted 28 Mar 2013 Link to this post

    Thank you for posting the Fix for this issue, Rene. I had the identical issue.

    Landon
  7. Poh Joon
    Poh Joon avatar
    9 posts
    Member since:
    Feb 2012

    Posted 28 Mar 2013 Link to this post

    Hi, update your js to the latest version 2.0.30116.0 should solve your issue if you are using jQuery 1.9.x. This can be done via nuget or install ASP.NET and Web Tools 2012.2 Update.
  8. Bradley Fulton
    Bradley Fulton avatar
    6 posts
    Member since:
    Jan 2010

    Posted 25 Jul 2013 Link to this post

    Upgrading to jQuery 2.0.3 also fixed similar issues with 716
Back to Top
UI for ASP.NET MVC is VS 2017 Ready