Introduction
Soap Env query used to access the list items in sharepoint by the help of ajax call.Here in this codes i get the list item field value for my purpose.
|
$(document).ready(function(){
/* Write the SoapEnv query according to your condition*/
var soapEnv = "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'><soapenv:Body><GetListItems
xmlns='http://schemas.microsoft.com/sharepoint/soap/'>";
soapEnv += "<listName>List_name</listName>";
soapEnv += "<ViewFields><FieldRef Name='Title'/></ViewFields>";
soapEnv += "<view><Query><Where><Eq><FieldRef Name='checked' /><Value Type='Boolean'>TRUE</Value></Eq></Where></Query></view>";
soapEnv += "</GetListItems></soapenv:Body></soapenv:Envelope>";
initialiseAjaxc(soapEnv);
function initialiseAjaxc(soapEnv)
{
/* By ajax call access the list by Soap Env query*/
$.ajax({
url: "http://abcde.abc.com/_vti_bin/Lists.asmx" ,
type: "POST",
dataType: "xml",
data: soapEnv,
complete: processResultc,
contentType: "text/xml; charset=\"utf-8\""
});
}
function processResultc(xData, status)
{
var count=0;
if (window.DOMParser)
{
parser=new DOMParser();
xmlDoc=parser.parseFromString(xData.responseText,"text/xml");
}
else
{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async=false;
xmlDoc.loadXML(xData.responseText);
}
$(xmlDoc).find("z\\:row, row").each(function() {
var value=$(this).attr('ows_checked');
/* Getting field values from the Url here */
});
}
});
|