delphinekkaink
New Member
I'm trying to access the response of a PROPFIND (webdav) Ajax request, which returns a file directory in XML.My request looks like this:\[code\]$.ajax({ url: url + '?_=' + Date.now(), type: 'PROPFIND', async: true, contentType: "text/xml; charset=utf-8", dataType: 'xml', crossdomain : true, headers : { Authorization: 'Basic ' + Base64.encode( priv.username + ':' + priv.password ), Depth: '1' }, success: function (xml) { console.log(xml); }});\[/code\]The request works fine, but I'm struggling to access the \[code\]xml\[/code\] response element. My XML response looks like this:\[code\] ... </D:supportedlock> <D:lockdiscovery/> </Drop> <D:status>HTTP/1.1 200 OK</D:status> </Dropstat></D:response><D:response xmlns:lp2="http://apache.org/dav/props/" xmlns:lp1="DAV:"> <D:href>/dav/ding.xml</D:href> <Dropstat> <Drop> ...\[/code\]I will need to run something like this:\[code\]var response = $(xml).find('D\\:response, response');\[/code\]which I'm also not sure about...Question:
Is there a way to get just the "plain" reponse XML text (same as shown in Firebug in the response)? And how do I access elements correctly?
Is there a way to get just the "plain" reponse XML text (same as shown in Firebug in the response)? And how do I access elements correctly?