qq_36203048
讲完这题就下课
2017-09-14 09:15

新手求解 javacript库代码删除sharepoint文件夹 找不到文件

  • sharepoint
     function deleteFolder(siteUrl) {
        var clientContext = new SP.ClientContext(siteUrl);
        oWebsite = clientContext.get_web();
        clientContext.load(oWebsite);
        clientContext.executeQueryAsync(function () {
            folderUrl = oWebsite.get_serverRelativeUrl() + "/Lists/Shared Documents/Folder1";
            folderToDelete = oWebsite.getFolderByServerRelativeUrl(folderUrl);
            folderToDelete.deleteObject();
            clientContext.executeQueryAsync(
                Function.createDelegate(this, successHandler),
                Function.createDelegate(this, errorHandler)
            );
        }, errorHandler);
        function successHandler() {
            alert("Go to the " +
                "<a href='../Lists/Shared Documents'>document library</a> " +
                "to make sure the folder is no longer there.");
        }
        function errorHandler() {
           alert("Request failed: " + arguments[1].get_message());
        }
    }

图片说明
图片说明
图片说明

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

2条回答

为你推荐

换一换