How can i access a list in a subsite?
function Read () {
var caml = "<View><ViewFields><FieldRef Name='Title'/><FieldRef Name='ID'/><RowLimit>2</RowLimit></ViewFields ></View>";
var context = new SP.ClientContext.get_current();
var items = contextManagement.get_web().get_lists().getByTitle("Posts");
var query = new SP.CamlQuery();
query.set_viewXml(caml);
results = items.getItems(query);
context.load(results);
context.executeQueryAsync(Function.createDelegate(this, this.Div_befuellen), Function.createDelegate(this, this.onFailure));
}
This is the code, i all ready use. But how i has to change the code when the list is not on a subsite (Root\SubSite)?
I like to show News on the start page of a site collection but the news list is on a subsite (SharePointServer\News) from the sitecollection.
Thanks for your help Stefan