Hi,
What is the difference between Java script Client Object Model and .SPServices using Jquery.
* Please help me to know how it process internally. (architecture)
* Advantage and disadvantage. Which should be used.
In this program, used to retrieve the lists using Client Object Model and SPService.
this.clientContext = SP.ClientContext.get_current();
if (this.clientContext != undefined && clientContext != null) {
var webSite = clientContext.get_web();
this.list = webSite.get_lists().getByTitle("MyList");
var query = SP.CamlQuery.createAllItemsQuery();
allItems = list.getItems(query);
clientContext.load(allItems, 'Include(Title,Extension)');
this.clientContext.executeQueryAsync(Function.createDelegate(this,onSuccess),Function.createDelegate(this,onFail));
} $().SPServices({
operation: "GetListItems",
async: false,
listName: "MyList",
completefunc: function (xData, Status) {
$(xData.responseXML).SPFilterNode("z:row").each(function () {
var liHtml = "<li>" + $(this).attr("ows_Title") + "</li>";
$("#listDisp").append(liHtml);
});
}
});Thanks,
Krishna