求助 !xmlhttp.responseXML 总是为空?????
时间:2005-04-28
来源:互联网
<:(SCRIPT language=JavaScript>
function reloadForm()
{
var xmldoc= new ActiveXObject("MSXML2.DOMDocument");
var xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
xmldoc.async = false;
var post=" ";
xmlhttp.open("POST","<%=path%>/showList.do",false);
xmlhttp.setRequestHeader("Content-Type","text/xml");
xmlhttp.setRequestHeader("Content-Type","gb2312");
xmlhttp.send(post);
alert(xmlhttp.Status+xmlhttp.StatusText);
document.open(); document.close();
var res=xmlhttp.responseXML;
xmldoc.load(res);
alert(xmldoc.xml);
}
</SCRIPT>
alert(xmlhttp.Status+xmlhttp.StatusText); 返回200OK
function reloadForm()
{
var xmldoc= new ActiveXObject("MSXML2.DOMDocument");
var xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
xmldoc.async = false;
var post=" ";
xmlhttp.open("POST","<%=path%>/showList.do",false);
xmlhttp.setRequestHeader("Content-Type","text/xml");
xmlhttp.setRequestHeader("Content-Type","gb2312");
xmlhttp.send(post);
alert(xmlhttp.Status+xmlhttp.StatusText);
document.open(); document.close();
var res=xmlhttp.responseXML;
xmldoc.load(res);
alert(xmldoc.xml);
}
</SCRIPT>
alert(xmlhttp.Status+xmlhttp.StatusText); 返回200OK
作者: qq123qq321 发布时间: 2005-04-28
可以试试xmlhttp.responseStream
作者: zhangshying 发布时间: 2005-04-28
也可以试试
xmlhttp.responseText 调试看看post过去的页面有没有什么错误..
xmlhttp.responseText 调试看看post过去的页面有没有什么错误..
作者: Eclipse 发布时间: 2005-05-17
直接显示xml呢?
alert(xmlHTTP.responseXML.xml);
或试试 utf-8 .
alert(xmlHTTP.responseXML.xml);
或试试 utf-8 .
作者: ※潇洒※ 发布时间: 2005-05-28
才在老外网站找到答案.说的是asp ,不知道对你这个有没帮助?
If the response was generated by an ASP page, and the MIME type was not correctly set to 'text/xml', responseXML will be empty.
If the response was generated by an ASP page, and the MIME type was not correctly set to 'text/xml', responseXML will be empty.
作者: ※潇洒※ 发布时间: 2005-05-28
多谢※潇洒※兄,真的是这个原因啊,要在服务器端把content-type设置为“text/xml”就解决了,崇拜崇拜:))))
BTW:与编码无关,:P
:
[ 本帖由 guo_q 最后编辑于 2005-9-7 10:37 ]
BTW:与编码无关,:P

[ 本帖由 guo_q 最后编辑于 2005-9-7 10:37 ]
作者: guo_q 发布时间: 2005-09-07
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28