社区
JavaScript
帖子详情
为什么responseXML总是为空,而改用responseText却收得到信息?
LAVENDER0071
2010-02-04 07:26:36
responseText能得到正常信息,reponseXML提示是DOM 对象,但是reponseXML.getElementsByTagName获取的值是null,能正常显示标签的长度,这是为什么么啊
...全文
252
11
打赏
收藏
为什么responseXML总是为空,而改用responseText却收得到信息?
responseText能得到正常信息,reponseXML提示是DOM 对象,但是reponseXML.getElementsByTagName获取的值是null,能正常显示标签的长度,这是为什么么啊
复制链接
扫一扫
分享
举报
写回复
配置赞助广告
11 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
lushuibin
2010-04-30
打赏
举报
回复
[Quote=引用 9 楼 sohighthesky 的回复:]
JScript code
node.childNodes[0].nodeValue;//文本节点才有内容
[/Quote]
这个应该加在哪里啊?
LAVENDER0071
2010-02-08
打赏
举报
回复
[Quote=引用 9 楼 sohighthesky 的回复:]
JScript codenode.childNodes[0].nodeValue;//文本节点才有内容
[/Quote]
大哥真是厉害啊,一语中的,就是这个问题,谢谢
sohighthesky
2010-02-05
打赏
举报
回复
node.childNodes[0].nodeValue;//文本节点才有内容
LAVENDER0071
2010-02-05
打赏
举报
回复
[Quote=引用 7 楼 kingwolf_javascript 的回复:]
晕。reponseXML.getElementsByTagName这样也可以?
[/Quote]
肯定不是这样,后面是调用具体的节点,nodeName是正确的,但是nodeValue一直是null
浴火_凤凰
2010-02-05
打赏
举报
回复
晕。reponseXML.getElementsByTagName这样也可以?
LAVENDER0071
2010-02-05
打赏
举报
回复
[Quote=引用 5 楼 xiaofanku 的回复:]
你的服务器端生成响应的MIME是?text/xml?
[/Quote]
设置了,我用的是ASP
Response.Charset="utf-8"
Response.ContentType="text/xml"
街头小贩
2010-02-05
打赏
举报
回复
你的服务器端生成响应的MIME是?text/xml?
LAVENDER0071
2010-02-05
打赏
举报
回复
<?xml version="1.0" ?>
- <transaction ID="THX1138">
<salesperson>bluemax</salesperson>
- <order>
- <product productNumber="3263827">
<quantity>1</quantity>
<unitprice currency="standard">3000000</unitprice>
<description>Medium Trash Compactor</description>
</product>
</order>
<return />
</transaction>
这是输出的XML
LAVENDER0071
2010-02-05
打赏
举报
回复
[Quote=引用 1 楼 free_wind22 的回复:]
responseXML.documentElement.getElementsByTagName
这样试下。
[/Quote]
能输出nodeName
happy664618843
2010-02-04
打赏
举报
回复
判断是否为空xmlHttp.responseXML.firstChild==null?
囧
2010-02-04
打赏
举报
回复
responseXML.documentElement.getElementsByTagName
这样试下。
相关推荐
response
Text
与
response
XML
While
response
Text
returns the HTTP
response
as a string,
response
XML
returns the
response
as
XML
"
response
Text
”属性以字符串形式返回HTTP响应;“
response
XML
”属性以
XML
形式返回HTTP响应。 The
Response
XML
property returns an ...
关于ajax的
response
XML
与
response
Text
response
XML
与
response
Text
的区别?
response
XML
返回的是
xml
dom对象,通过该对象可以访问
xml
文件的节点、属性节点、值节点。 而
response
Text
返回的是文本字符串,可以直接打印输出。
response
XML
在各大浏览器中的使用: IE和Opera支持
response
XM
ajax中
response
Text
与
response
XML
区别
原文:http://lou888.blog.hexun.com/46543491_d.html ajax中
response
Text
与
response
XML
区别 1、"
response
Text
”属性以字符串形式返回HTTP响应;“
response
XML
”属性以
XML
形式返回HTTP响应。 function getTel() { var tel
Text
= document.getE
ajax中
response
Text
与
response
XML
区别-Nazgul
原文:http://lou888.blog.hexun.com/46543491_d.html ajax中
response
Text
与
response
XML
区别 1、"
response
Text
”属性以字符串形式返回HTTP响应;“
response
XML
”属性以
XML
形式返回HTTP响应。 function getTel() { var tel
Text
= document.
response
Text
和
response
XML
response
Text
属性 如果来自服务器的响应并非
XML
,请使用
response
Text
属性。
response
Text
属性返回字符串形式的响应,因此您可以这样使用: document.getElementById("myDiv").innerHTML=
xml
http.
response
Text
;
response
XML
属性 如果来自服务器的响应是
XML
,而且需...
发帖
JavaScript
JavaScript
Web 开发 JavaScript
复制链接
扫一扫
8.7w+
社区成员
22.4w+
社区内容
Web 开发 JavaScript
社区管理员
加入社区
获取链接或二维码
帖子事件
创建了帖子
2010-02-04 07:26
社区公告
暂无公告