jquery获取XML节点名称的几种方法以:
• get(0).tagName
$(this).get(0).tagName
• [0].tagName[0]
$(this)[0].tagName
• context.nodeName
$(this).context.nodeName
function getXMLData(){
$.ajax({
url:'data.xml',
type: 'GET',
dataType: 'xml',
timeout: 1000,
error: function(xml){
alert('Error loading XML document'+xml);
},
success: function(xml){
$("data",xml).children().each(function(){
alert($(this).context.nodeName);
});
}
});
}
以上这篇jquery解析XML及获取XML节点名称的实现代码就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持脚本之家。
最后
以上就是直率战斗机最近收集整理的关于jquery解析XML及获取XML节点名称的实现代码的全部内容,更多相关jquery解析XML及获取XML节点名称内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复