-3
創建文檔庫,當用戶點擊按鈕的HTML文檔庫應該created.I已經看到了一些他們通過修改app.js文件中使用的應用程序開發方法,但我想通過實施這一使用Sharepoint設計器的.txt文件。如何在SharePoint上的按鈕,點擊使用javascript
創建文檔庫,當用戶點擊按鈕的HTML文檔庫應該created.I已經看到了一些他們通過修改app.js文件中使用的應用程序開發方法,但我想通過實施這一使用Sharepoint設計器的.txt文件。如何在SharePoint上的按鈕,點擊使用javascript
請複製下面的代碼剪斷的PlaceHolderMain線即
<script language="javascript" type="text/javascript">
function onQuerySucceeded(sender, args) {
alert('List created');
}
function onQueryFailed(sender, args) {
alert('request failed to create a list');
}
function createNewList() {
var clientContext = new SP.ClientContext.get_current();
this.oWebsite = clientContext.get_web();
//Logic to create a new list and library
clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
}
</script>
<input id="Button1" type="button" value="Create a new list/ Library" OnClick="createNewList()" />
希望這有助於你在下面。