Note that there are some explanatory texts on larger screens.

plurals
  1. PONew version of jQuery loads another page instead of replacing div
    primarykey
    data
    text
    <p>I don't know what I did wrong, but by updating to a newer version of jQuery, my ajax page doesn't work anymore.</p> <p>I was using 1.8.3 from google CDN and now I'm trying to use 1.9.1. I have also updated jQuery UI to the 1.9.2 also from the google CDN. Finally, I have taken the latest "jquery.unobtrusive-ajax.min.js" for my page.</p> <p>Everything works fine on my website, except the page where I use ajax call to replace div on my page. This page was working perfectly but now when the user click submit, it just load into another page.</p> <p><a href="http://jsfiddle.net/zkhKC/#" rel="nofollow">Here is a jsfiddle</a> that simplify my page a lot. I don't know how to call a "fake controller" in jsfiddle that could return simple html so modify it if you want. By clicking the button, it's supposed to replace the div with the same GUID. The Ajax call has been generated with the Ajax object from MVC 3. Like this:</p> <pre><code> using (Ajax.BeginForm("AddSubtitle", "Recipe", new AjaxOptions { UpdateTargetId = superGuid, HttpMethod = "POST", InsertionMode = InsertionMode.Replace, OnSuccess = "done" })) { &lt;input type="hidden" name="IDRecipe" value="@Model.IDRecipe" /&gt; &lt;a name="SubtitleSection" &gt;&lt;/a&gt; &lt;input class="field required span6 text-box single-line" name="Name" /&gt; &lt;input type="submit" class="btn btn-success" value="Ajouter une catégorie d'ingrédient" /&gt; } </code></pre> <p>My controller seems to work very well since in the new page that opens the content is perfect. Here it is so that you have all the piece of the puzzle.</p> <pre><code>[HttpPost] [Authorize] public PartialViewResult AddSubtitle(Subtitle sub) { Recipe realRecipe = db.Recipes.Find(sub.IDRecipe); if ((Guid)Membership.GetUser().ProviderUserKey == realRecipe.IDUser || User.IsInRole("Admin")) { sub.Order = realRecipe.Subtitles.Count + 1; if (sub.Name != null &amp;&amp; sub.Name != "") { realRecipe.Subtitles.Add(sub); db.SaveChanges(); } else ModelState.AddModelError("", "Le nom de la catégorie ne peut pas être vide!"); return PartialView("_SubtitleList", Utils.GetListIngredientAndSubtitle(realRecipe.IDRecipe, realRecipe.Subtitles)); } else return PartialView("_SubtitleList", null); } </code></pre> <p>Anybody can help me with this?</p>
    singulars
    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