我不知道为什么有时候找不到这份名单?虽然网络主机中的列表不会消失。我不知道问题出在哪里或如何解决。
function createList() {
var context = new SP.ClientContext();
var list = context.get_web();
var listCreation = new SP.ListCreationInformation();
(listCreation.set_title("MyExpenseList"))
listCreation.set_templateType(SP.ListTemplateType.genericList);
var olist = list.get_lists().add(listCreation)
list.update();
context.load(olist);
context.executeQueryAsync(onListCreationSuccess, onListCreationFail);
}
function onListCreationSuccess() {
$('#message').text("List got created");
}
function onListCreationFail(sender, args) {
alert('Failed to get user name. Error:' + args.get_message());
}