Search code examples
sharepoint-2010spservices

Can we access list from different site collection using SPService JQuery?


I want to read list from different site collection. Is there any way to do this ?


Solution

  • Here is the sample successfully tested with SPServices JQuery 2014.01:

            $().SPServices({
            operation: "GetListItems",
            // Force sync so that we have the right values for the child column onchange trigger
            async: false,
            webURL: "/webs/sitecollection/site",
            listName: "tst",
            // Filter based on the currently selected parent column's value
            // Only get the parent and child columns
            CAMLViewFields: "<ViewFields><FieldRef Name='Title' /></ViewFields>",
            // Override the default view rowlimit and get all appropriate rows
            CAMLRowLimit: 0,
            completefunc: function(xData, Status) {
                window.alert(Status);
            }
        });