首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >IE9 xdr.open()不工作--我哪里做错了?

IE9 xdr.open()不工作--我哪里做错了?
EN

Stack Overflow用户
提问于 2012-06-10 07:58:04
回答 1查看 695关注 0票数 0

这是我的代码。

我知道它指向localhost。但是,它应该是你的404。如果你能达到404,那你就领先于我了。

我已经使用过IE9的调试控制台,并且可以在"xdr.open()“调用之前进行调试。

我在net面板中没有看到任何东西。请帮帮忙。

代码语言:javascript
复制
$('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周围复制/粘贴的拼写错误--仍然不能工作?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-06-11 14:38:02

我发送了两次access-control-allow-origin:*头(一次是在.htaccess中,一次是在php脚本中)

使用chromebug检查"Raw Headers“而不仅仅是"headers”;)

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/10965457

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档