gpt4 book ai didi

javascript - air xmlhttprequest 无法发送 GET 参数

转载 作者:行者123 更新时间:2023-11-28 09:27:26 25 4
gpt4 key购买 nike

这是在单击按钮时调用的代码,并且工作正常

var console = console || 
{log:function(msg){window.runtime.trace(msg);}};
console.log("opening link:"+bannerurl);
var xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", bannerurl,false);
xmlhttp.send(null);
document.getElementById("banner").innerHTML=xmlhttp.responseText;

输出为:

opening link:http://www.mysite.com

当我添加以下行时:

bannerurl=bannerurl+"?hi=22";

输出为:

> opening link:http://www.mysite.com?hi=22 
> Error: NETWORK_ERR:XMLHttpRequest Exception 101
> setup1 at app:/js/result.js : 435

网址http://www.mysite.com?hi=22 (作为示例,用 mysite 替换了真实的 url)工作得非常好,并且代码在带有forcecors 的 Firefox 中工作得很好,但无法在 AIR 中运行。

对 AIR 的提示稍后当我被允许时会回答这个问题。问题是 IE 设置为离线工作,因此只有已缓存的页面可以工作,而新页面(具有不同的 GET 参数)则不能工作

最佳答案

我发现 Internet Explorer 处于离线模式。我几乎从不使用 IE,所以没有注意到这一点。

关于javascript - air xmlhttprequest 无法发送 GET 参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14170035/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com