这是我的代码。
我知道它指向localhost。但是,它应该是你的404。如果你能达到404,那你就领先于我了。
我已经使用过IE9的调试控制台,并且可以在"xdr.open()“调用之前进行调试。
我在net面板中没有看到任何东西。请帮帮忙。
$('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!');
}
});编辑:更正了在xdr.setTimeout周围复制/粘贴的拼写错误--仍然不能工作?
发布于 2012-06-11 14:38:02
我发送了两次access-control-allow-origin:*头(一次是在.htaccess中,一次是在php脚本中)
使用chromebug检查"Raw Headers“而不仅仅是"headers”;)
https://stackoverflow.com/questions/10965457
复制相似问题