2016-03-04 62 views
2

我正在尝试使用jquery来访问xml标签的属性值。 我试图访问XML标记属性是:无法使用jquery获取xml属性的值

<yweather:condition code="30" date="Fri, 04 Mar 2016 12:53 pm AKST" temp="11" text="Partly Cloudy"/> 

我想成功函数内部按如下方式访问:

alert($(xml).find('yweather:condition').attr("temp")); 

但它提醒“不确定”。无法理解什么地方出了错

回答