This project has moved and is read-only. For the latest updates, please go here.

xData Parameter

Nov 9, 2011 at 5:29 PM

I need to inspect the xData parameter passed to the completefunc.  I have looked through the documentation and must be overlooking something.

In my case, the Status parameter has the value "error" and I need to look at xData, and determine specifics about the error in order to provide meaningful feedback to the end user.

What is it?  Xml? A javascript object?

Nov 9, 2011 at 9:02 PM

The Web Services return XML. You can alert(xData.responseText), poke the contents into the DOM to view it, or use a browser add-on like Firebug.


Nov 9, 2011 at 9:18 PM

Thanks for the reply. 

Firebug was invaluable, used the Network feature to see the raw soap xml returned, and from that was able to determine the structure of the xml in xData.responseXML. Here's the code I ended up using to discover the error info.

errorCode = $(xData.responseXML).find("ErrorCode").text();

And here is a snippet of the raw soap xml returned under this error condition (adding the same link to the user's favorites when the link already exists):

<faultstring>Operation Failure ---&gt; There is an existing link with the same title, group, and URL.</faultstring>
<ErrorCode xmlns="">PrivacyItemExists</ErrorCode>
<ErrorMessage xmlns="">There is an existing link with the same title, group, and URL.</ErrorMessage>