How to parse xml attributes with jQuery alone?

后端 未结 3 1820
名媛妹妹
名媛妹妹 2020-12-31 04:57

I\'m already parsing xml successfully but i\'m stuck at getting an attribute of childrens.

XML Example:


    
        <         


        
3条回答
  •  长情又很酷
    2020-12-31 05:27

    Aah, namespaces are a different kind of animal, it wasn't in your original post. You have to escape the : in your selector.

    var pic = $entry.find('media\\:thumbnail').attr('url');
    

    http://jsfiddle.net/JSrJe/1/

    See also jQuery XML parsing with namespaces

提交回复
热议问题