Note that there are some explanatory texts on larger screens.

plurals
  1. POAJAX call not working when async: true
    text
    copied!<p>So I want this AJAX-call to run asynchronously but it only works with async: false</p> <pre><code> var url = 'Default.aspx/CheckLogin'; $.ajax({ async: true, // works with async: false type: "POST", contentType: "application/json; charset=utf-8", url: url, data: '{"email":"' + email.val().trim() + '", "password":"' + password.val().trim() + '"}', dataType: "json", success: function (data) { alert("success!"); }, error: function (result,something,error) { alert("Error: " + error); } }); </code></pre> <p>EDIT:</p> <p>When async is true the alert will show immediately with "Error:", that is no error msg. The CheckLogin function is pretty slow so when it actually runs it it takes a while.</p> <p>Any idea of what I'm doing wrong?</p> <p>EDIT 2:</p> <p>This is some info I got from chrome://net-internals/#events:</p> <pre><code> t=1381258516496 [st= 0] +REQUEST_ALIVE [dt=12] t=1381258516497 [st= 1] +URL_REQUEST_START_JOB [dt=11] --&gt; load_flags = 142737665 (ENABLE_LOAD_TIMING | MAYBE_USER_GESTURE | REPORT_RAW_HEADERS | VALIDATE_CACHE | VERIFY_EV_CERT) --&gt; method = "POST" --&gt; priority = 2 --&gt; upload_id = "0" --&gt; url = "http://localhost:1176/web_new/Default.aspx/CheckLogin" t=1381258516497 [st= 1] HTTP_CACHE_GET_BACKEND [dt=0] t=1381258516497 [st= 1] +HTTP_STREAM_REQUEST [dt=11] t=1381258516508 [st=12] CANCELLED t=1381258516508 [st=12] -HTTP_STREAM_REQUEST t=1381258516508 [st=12] -URL_REQUEST_START_JOB --&gt; net_error = -3 (ERR_ABORTED) t=1381258516508 [st=12] -REQUEST_ALIVE </code></pre>
 

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