Here is my code.
I know it’s pointing to localhost. However, it should 404 for you. If you can get it to 404, you’re ahead of me.
I have used IE9’s debugging console and I can get upto right before the “xdr.open()” call.
I do not see anything in the net panel. Please help.
$('body').on('click','.click',function() {
if (window.XDomainRequest) {
xdr = new XDomainRequest();
xdr.onload = function() {
xdr.contentType = "text/plain";
alert('load');
};
xdr.onerror = function() {
alert('error');
};
xdr.onprogress = function() {
alert('progress');
};
xdr.ontimeout = function() {
alert('timeout');
};
xdr.timeout = 10000;
alert('Preparing to open connection...');
xdr.open( 'GET', host + '/bookmarklet/saveData/' );
alert('If you see this message, the connection is opened');
xdr.send( ( s.hasContent && s.data ) || null );
alert('If you see this message, the data has been sent!');
}
});
EDIT: corrected a typo from copy/paste around xdr.setTimeout — still doesn’t work?
I was sending the access-control-allow-origin: * header twice (once in .htaccess, once in php script)
Check “Raw Headers” not just “headers” using chromebug 😉