Expose errors by:
$.ajax("http://www.jsfiddle.net").fail(function (e) {
console.log(e);
});
You will get:
InvalidStateError: Failed to execute 'setRequestHeader' on 'XMLHttpRequest': the object's state must be OPENED.
This means you need to call open()
before you call setRequestHeader()
.
Then you will run into the cross domain issue. Make sure you're not trying to do a cross domain request to an unsupported domain. The shell runs from http://fiddle.jshell.net
.
Requesting that domain works (returns HTML).