Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function StoreInArray() {
- var CallLibrary = GetListItems();
- $.when(CallLibrary).then(function (FilesData) {
- for (var i = 0; i < FilesData.d.results.length; i++) {
- var name = FilesData.d.results[i].Name;
- var url = FilesData.d.results[i].ServerRelativeUrl;
- var newDiv = document.createElement('div');
- // Here I show document name and create link to open the sharepoint site
- $('#DocName').append("<div><a href='' >" + name + "</a></div>");
- }
- });
- }
- function GetListItems() {
- var siteURL = "http://localhost:8032/_api/web/GetFolderByServerRelativeUrl('docList')/Files";
- return $.ajax({
- url: siteURL,
- async: false,
- method: "GET",
- headers: { "Accept": "application/json;odata=verbose" }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement