jQuery XML parsing how to get element attribute

前端 未结 2 1366
醉梦人生
醉梦人生 2020-12-18 08:04

XML:


     Some title

     
     

        
相关标签:
2条回答
  • 2020-12-18 08:15

    Your XML uses a namespace.

    See this similar Stack Overflow question regarding namespaces. You have to escape the colon:

    jQuery XML parsing with namespaces

    0 讨论(0)
  • 2020-12-18 08:29

    Got a correction for you.. and your Namespace SOLUTION! You need to escape the namespace ":" properly with \. I have show the example below which works with the Itunes podcast XML feeds.

     item.description = jQuery(this).find("[nodeName=itunes\\:summary]").eq(0).text();
    
    0 讨论(0)
提交回复
热议问题