I'm trying to get data using sharepoint web service, phoneGap and windows phone 8. When i test the code below it gives this error :
Error:"Unable to get property 'content' of undefined or null reference file:x-wmapp0:www/webs.html Line:1"
Any help please ?
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.4.js" type="text/javascript"></script>
<script src="cordova-2.3.0.js" type="text/javascript"></script>
</head>
<body>
<div>
<script type="text/javascript">
$(document).ready(function () {
var soapEnv =
"<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'> \
<soapenv:Body> \
<GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'> \
<listName>Comptes</listName> \
<viewFields> \
<ViewFields> \
<FieldRef Name='WorkAddress' /> \
</ViewFields> \
</viewFields> \
</GetListItems> \
</soapenv:Body> \
</soapenv:Envelope>";
// Call web service
$.ajax({
url: "http://demo-crm.progedsolutions.com/sites/CRM/_vti_bin/lists.asmx",
type: "POST",
dataType: "xml",
data: soapEnv,
complete: processListAccessResult,
contentType: "text/xml; charset=\"utf-8\"",
success: function () {
alert("success");
},
error: function () {
alert("ERROR");
},
});
});
// Process result
function processListAccessResult(xData, status) {
$(xData.responseXML).find("z\\:row").each(function () {
$("#data").append("<li>" + $(this).attr("ows_WorkAddress") + "</li>");
});
}
</script>
<ul id="data"></ul>
</div>
</body>
</html>