Gets the list under the current site (child site instead of site collection)
var clientcontext = new SP. Clientcontext.get_current ();
var list=clientcontext.get_web (). Get_lists (). Getbytitle ("list name");
Other sub-stations
var clientcontext = new SP. ClientContext (' site path ');
var list=clientcontext.get_web (). Get_lists (). Getbytitle ("list name");
var camlquery = new SP. Camlquery ();
var roles = ["Ca erpcountersign", "Ca ibdcountersign"];
var xmlstring = "<View><Query></Query></View>";
Camlquery.set_viewxml (xmlstring);
var Colllistitem = List.getitems (camlquery);
Clientcontext.load (Colllistitem);
Clientcontext.executequeryasync (function () {
var listiteminfo = "";
var listitemenumerator = Colllistitem.getenumerator ();
while (Listitemenumerator.movenext ()) {
var olistitem = listitemenumerator.get_current ();
$.each (Olistitem.get_item (' field name '), function (I, D) {
Listiteminfo + = D.$2d_1 + ";";
})
}
}, function () {
Alert ("error!");
});
SharePoint's JavaScript Client object model gets a list of other sites