I declared success and error callbacks, but in the case of status code 200 also only calls error callbacks.
I am making a curl call to another php file inside registry.php .
Here is what I tried:
$.ajax({ type: "POST" ,data: { action: "blah" ,mobileNo: that.mobNo ,token: that.key } ,url: "http://90.8.41.232/localhost/registry.php" ,cache: false ,dataType: "json" ,success: function (response) { console.log("success"); } ,error: function () { console.log("error"); } });
I read in the documentation that we should not explicitly refer to the callback, we hope that this will be correct.
Any idea how to call a success callback when it's a 200 status code.
REACTION hope this helps, I copied chrome from the console, and did not print console.log ().
bort: (statusText) always: () complete: () done: () error: () fail: () getAllResponseHeaders: () getResponseHeader: (key) overrideMimeType: (type) pipe: () progress: () promise: (obj) readyState: 4 responseText: "{"success":"Mobile No 9535746622 is approved"} {"report":true}" setRequestHeader: (name,value) state: () status: 200 statusCode: (map) statusText: "OK" success: () then: ()
source share