显示object.responseXML文本以进行调试

Rya*_*anS 5 javascript xml debugging sharepoint jquery

我正在使用以下脚本:

<script type="text/javascript"> 
    function processResult(xData, status) { 
       $('.feedbackLink').empty(); 
        alert ($(xData.responseXML.xml));
        console.log($(xData.responseXML.xml));
        $(xData.responseXML).find("z\\:row").each(function() { 
            alert ($(this));
            var title = $(this).attr("ows_Title"); 
            var url = $(this).attr("ows_Contact"); 
            $('.feedbackLink').append("<a href="+url+">"+title+"</a>"); 
       }); 

   };

   $(document).ready(function() { 
   alert("ready"); 
       var soapEnv = "<?xml version='1.0' encoding='utf-8'?> <soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'> <soapenv:Body> <GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'> <listName>Pages</listName> <viewFields> <ViewFields> <FieldRef Name='Title' /> <FieldRef Name='Contact' /> </ViewFields> </viewFields> </GetListItems> </soapenv:Body> </soapenv:Envelope>";       
       $.ajax({ 
           url: "/_vti_bin/lists.asmx", 
           type: "POST", 
           dataType: "xml", 
           data: soapEnv, 
           complete: processResult, 
           contentType: "text/xml; charset=\"utf-8\"" 
       });
       alert(soapEnv); 
   }); 

    </script>
Run Code Online (Sandbox Code Playgroud)

但警报内$(xData.responseXML).find("z\\:row").each(function() {不会发生火灾.如何查看responseXML?我想仔细检查我正在寻找正确的标识符(我不知道它ows_来自哪里,我得到了这个脚本可以使用).

alert和console.log只显示[object Object].

关于如何调试这个的任何建议?

Bra*_*sen 1

尝试使用firefox 的firebug查看错误消息和console.log.