jquery解析XML及获取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);
            });
        }
    });
}

转自:http://www.cnblogs.com/zhangfei/archive/2013/01/22/2871177.html