xmlhttp在open的时候报错“不能写入”。何解?

manyufei manyufei 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区

var xmlhttp;
function createHTTP()
{
try
{
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e2)
{
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest != 'undefined')
{
xmlhttp = new XMLHttpRequest();
}
}

function startHTTP()
{
createHTTP();
try
{
xmlhttp.open("GET","http://......",true);
xmlhttp.send(null);
if(xmlhttp.readystate == 4)
{
alert(xmlhttp.responsetext);
}
}
catch(e)
{
alert(e.message);
}
}


这段代码保存在一个html文件中,通过iis6执行,在执行到xmlhttp.open()时就会抛出例外,说不能写入。但如果直接在IE中打开这个文件就没有问题,真的是搞不懂了。
我的系统是Windows Server 2003 R2+SP2, IE7, iis6。
先谢谢各位了。
...全文

相关推荐

评论 4
收藏 已收藏
分享
返回顶部
manyufei
Ajax 52,778 成员 25,334 内容