Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery $.get against ASP.NET MVC not working in Opera and Firefox
    primarykey
    data
    text
    <p>Let me first put the code snippets here. I am just using the ASP.NET MVC project Visual Studio creates out of the box. So I am just putting the snippets I added to it:</p> <p>Site.master's head section:</p> <pre><code>&lt;head runat="server"&gt; &lt;title&gt;&lt;asp:ContentPlaceHolder ID="TitleContent" runat="server" /&gt;&lt;/title&gt; &lt;script src="../../Scripts/jquery-1.3.2.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;link href="../../Content/Site.css" rel="stylesheet" type="text/css" /&gt; &lt;script src="../../Scripts/test.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt;$(document).ready(ready);&lt;/script&gt; &lt;/head&gt; </code></pre> <p>Content of test.js:</p> <pre><code>function ready(){ $.get("/Home/TestAjax", ajaxResponse); } function ajaxResponse(data){ alert("got response from server: " + data); } </code></pre> <p>Method in HomeController:</p> <pre><code> public String TestAjax() { if (Request.IsAjaxRequest()) { return "Got ajax request!"; } else { return "Non-ajax request"; } } </code></pre> <p>Now the problem I am seeing in Firefox 3.5.30729 (Firebug) is when the ajax request goes out, IIS 7 on the remote box sends Http 302 back, which does the redirect and forces another get request, but it is not asynchronous. Opera also doesn't work so I assume it is the same problem. However, above code works just fine in IE 8, Chrome, and Safari. </p> <p>On localhost all of the above browsers work as expected including Firefox and Opera -- they all receive "Got ajax request!" as the response from the server.</p> <p>Anybody have any ideas what's going on here and how to fix it? I am looking for a real solution or at least explanation as to what is going on and why.</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