Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery Ajax & Microsoft JScript runtime error: Syntax error, unrecognized expression:
    primarykey
    data
    text
    <p>I am working on the ode-to-food MVC4 demo app on Pluralsite by Scott Allen and have a troublesome error enabling ajax calls. I am thinking this may have something to do with my more recent jquery version but not sure.</p> <p>When I uncomment following line to activate ajax call I get the Microsoft JScript runtime error, otherwise it works fine:</p> <pre><code>$('form[data-ucw-ajax="true"]').submit(ajaxFormSubmit); </code></pre> <p><strong>The error is:</strong></p> <pre><code>Unhandled exception at line 4411, column 2 in http://localhost:17471/Scripts/jquery-1.9.0.js 0x800a139e - Microsoft JScript runtime error: Syntax error, unrecognized expression: &lt;div class="wrapper clearfix"&gt; .... &lt;/div&gt; &lt;hr /&gt; </code></pre> <p><strong>My View has this form:</strong></p> <pre><code>&lt;form method="get" action="@Url.Action("Index")" data-ucw-ajax="true" data-ucw-target="#facilitiesList"&gt; </code></pre> <p><strong>My JQuery code is:</strong></p> <pre><code>$(function () { var ajaxFormSubmit = function () { var $form = $(this); var options = { url: $form.attr('action'), type: $form.attr('method'), data: $form.serialize() }; $.ajax(options).done(function (data) { var $target = $($form.attr('data-ucw-target')); var $newHtml = $(data); $target.replaceWith($newHtml); $newHtml.effect('highlight'); }); return false; }; $('form[data-ucw-ajax="true"]').submit(ajaxFormSubmit); }); </code></pre> <p><strong>My Script Load Bundles look like:</strong></p> <pre><code>bundles.Add(new ScriptBundle("~/bundles/jquery/ucw").Include( "~/Scripts/jquery-{version}.js", "~/Scripts/jquery-ui-{version}.js", "~/Scripts/jquery.unobtrusive*", "~/Scripts/jquery.validate*", "~/Scripts/jquery-migrate-1.0.0.js", "~/Scripts/My.js" )); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload