Note that there are some explanatory texts on larger screens.

plurals
  1. POEmpty string passed to getElementById() at query.unobtrusive-ajax.js:16
    text
    copied!<p>I'm developing an ASP.NET MVC4 application and have started using jQuery actionlinks. However when I run the following Razor code (and click the view ticket actionlink) I get a generic jQuery error (twice) saying that an empty string was passed to getElementById(). I have no idea where this error is happening since firefox merely links to the jQuery code. This is my Razor code: (I know the js functions show and hideticket are empty but that is to simplify the code):</p> <pre><code>&lt;script&gt; function ShowTicket(id) { $("#viewTicketButton" + id).hide(); $("#hideTicketButton" + id).show(); $("#viewTicket").show(); } function HideTicket(id) { $("#viewTicketButton" + id).show(); $("#hideTicketButton" + id).hide(); $("#viewTicket").hide(); } &lt;/script&gt; &lt;h3&gt;Your tickets&lt;/h3&gt; &lt;table border="1"&gt; &lt;tr&gt; &lt;td&gt;Title:&lt;/td&gt; &lt;td&gt;Urgency:&lt;/td&gt; &lt;td&gt;Status:&lt;/td&gt; &lt;/tr&gt; @foreach (SupportTicketViewData t in Model.supportTicketViewDataList) { &lt;tr&gt; &lt;td&gt;@t.title&lt;/td&gt; &lt;td&gt;@t.text&lt;/td&gt; &lt;td&gt;@t.status&lt;/td&gt; &lt;td&gt;@Ajax.ActionLink("View Ticket", "ViewTicket", new { id = t.id }, new AjaxOptions { HttpMethod = "GET", InsertionMode = InsertionMode.Replace, UpdateTargetId = "viewTicket", OnComplete = "ShowTicket(" + t.id +");" }, new { id = "viewTicket" + t.id })&lt;/td&gt; &lt;td&gt;&lt;button id="@Html.Raw("HideTicket" + t.id)" onclick="HideTicket(@t.id);"&gt;Hide Ticket&lt;/button&gt;&lt;/td&gt; &lt;/tr&gt; } &lt;/table&gt; &lt;div id="viewTicket"&gt; &lt;/div&gt; </code></pre> <p>Also I get a result from the GET request just fine since it get's inserted into the div element however I get 2 errors when debugging in firefox.</p> <p>Also when I click the viewTicketButton the button doesn't hide as it should.</p>
 

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