2016-03-04 33 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")); 

但它提醒「不確定」。無法理解什麼地方出了錯

回答