3

Error message is

{"readyState":0,"status":0,"statusText":"NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load...

When the following is executed

$.ajax({
      url: "http://swingd.achievedigital.com/action/user_signin.php",
      dataType: 'json',
      crossDomain: true,
      method: 'POST',
      async: false,
      data: pstr,
      success: function(data) 

Changing

Async: false to true

causes this error:

{"readyState":0,"responseText":"","status":0,"statusText":"error"}--"error"--""

Anyone have any suggestions? Anything would be greatly appreciated.

John English
  • 31
  • 1
  • 2
  • Is it cross-domain? Have you checked whether that URL accessible? – Lucas Rodrigues Dec 04 '15 at 15:51
  • Do you have a `beforeSend` defined somewhere? – Mr. Llama Dec 04 '15 at 15:51
  • 4
    There could be many reasons why you are seeing this - all this tells us is that your ajax request failed. Please log the errors and add those to this post. Do so by adding `error: function( jqXHR, textStatus, error ) {console.log(jqXHR, textStatus, error);}` below the `success` property and running the ajax request again. – Andy Noelker Dec 04 '15 at 15:54
  • Does this answer your question? [Does an HTTP Status code of 0 have any meaning?](https://stackoverflow.com/questions/3825581/does-an-http-status-code-of-0-have-any-meaning) – Michael Freidgeim Dec 24 '21 at 05:19

1 Answers1

2

Usually, a response of 0 means that the request was not even allowed to reach the server (or the server did not support CORS).

See XMLHttpRequest status 0 (responseText is empty)

Community
  • 1
  • 1
Ruan Mendes
  • 90,375
  • 31
  • 153
  • 217