2012-09-18 33 views
0

我正在使用Jquery調用Weather Underground XML api。在瀏覽器中準備好文檔時定義的函數下面。很簡單的東西。我很好奇的一件事是當我使用dataType設置爲「xml」時返回的xml對象。我看到很多例子,人們調用諸如returned_xml.find()之類的函數來定位xml中的特定元素。我似乎無法找到xml對象的api上非常好的文檔。任何指針? THX需要更多關於ajax返回的xml對象的信息jQuery的調用

$(document).ready(function() { 
      jQuery.support.cors = true; // force cross-site scripting (as of jQuery 1.5) 
     $.ajax(
        {  url : "http://api.wunderground.com/api/0787878787878/geolookup/conditions/q/IA/Cedar_Rapids.xml", 
        dataType : "xml", 
        success : function(returned_xml) 
        { alert("Data is " + returned_xml.xml); 
         }, 
        error : function(failed_data) 
        { 
         alert("failed with " + failed_data); 
        } 
        }); 
}); 

回答

相關問題