sharepoint 通过ID获取列表项
示例
SP.SOD.executeOrDelayUntilScriptLoaded(myFunction,"sp.js"); function myFunction(){ var clientContext = new SP.ClientContext(); var list = clientContext.get_web().get_lists().getByTitle("List Title"); var item = list.getItemById(1); //获取ID==1的商品 clientContext.load(item); clientContext.executeQueryAsync( function(){ //成功 var title = item.get_item("Title"); alert(title); }, function(sender,args){ //onError alert(args.get_message()); } ); }