After executing the code in the console, I expected to see the ajax object with a readyState of 0 (as I aborted the ajax call). However, Chrome is displaying the number 4 in the console instead of 0. This discrepancy is surprising.
temp = new XMLHttpRequest();
temp.open("POST","http://jsfiddle.net/",true);
temp.onreadystatechange = function() {
console.log(temp);
console.log(temp.readyState);
};
temp.send(null);
temp.abort();
Can someone help resolve this issue with Chrome? I plan to report it as a bug but would appreciate insights from those more knowledgeable than myself.
--
ATTENTION:
It seems my question went unanswered.
temp = new XMLHttpRequest();
temp.open("POST","http://jsfiddle.net/",true);
temp.onreadystatechange = function() {
console.log(temp);
console.log(temp.readyState);
};
temp.send(null);
temp.abort(); Why does the readyState property of the temp object show differently when printed in the console? It should be consistent, regardless of browser behavior.
If an object's property xxx is set to 0, then object.xxx MUST be 0, as illustrated by this example showing the bug.