This is how I am invoking the click :
$("#myDivId").click(function(e) {
callAjax();
window.location = 'localhost://myhomepage'
});
Within error the error callback I have this :
function callAjax(){
$.ajax({
url: "myurl",
type: 'POST',
dataType : "text",
data : ({
json : myjson
}),
success : function(data) {
},
error : function() {
console.log("readyState: "+xhr.readyState);
console.log("status: "+xhr.status);
console.log("responseText: "+xhr.responseText);
}
});
}
The console output is :
readyState : 0
status : 0
responseText :
Since the console output is not useful, if success is being called why is the error callback being invoked?
If I remove the window.location call after the call to callAjax the error callback is not invoked.
Something is wrong with your code.
ReadyState 0means: The object has been created, but not initialized (the open method has not been called). ☛sourceSo the Ajax call is not sent at all. Please post more details from your code. What is the network-console saying?