Function.createDelegate(this,this.onQueryFailed) ); } 函数onQuerySucceeded(){ 提醒('列表项已删除:'+ itemId); }   ; $ 函数onQueryFailed(发件人,args){ 提醒('请求失败。'+ args.get_message()+ '\ n '+ args.get_stackTrace()); } < / script> ;<script type="text/javascript">function DeleteItem() { debugger; this.itemId = 1; var ctx = new SP.ClientContext(); var List = ctx.get_web().get_lists().getByTitle('CustomList'); this.ListItem = List.getItemById(itemId); ListItem.deleteObject(); ctx.executeQueryAsync( Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed) ); } function onQuerySucceeded() { alert('List Item deleted: ' + itemId); } function onQueryFailed(sender, args) { alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace()); } </script> 这篇关于在sharepoint 2013中使用javascript删除列表项目版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-22 19:29