zoukankan      html  css  js  c++  java
  • jquery解析XML及获取XML节点名称

    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);
                });
            }   
        });
    }

  • 相关阅读:
    初识python
    文件操作
    初识python
    pycharm IDE
    初识python
    初识Python
    python之网络编程-多线程
    python之并发编程-进程之间的通信
    python之并发编程-多进程
    python之并发编程-操作系统
  • 原文地址:https://www.cnblogs.com/zhangfei/p/2871177.html
Copyright © 2011-2022 走看看