Advertisement
Guest User

Untitled

a guest
Feb 21st, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. function StoreInArray() {
  2. var CallLibrary = GetListItems();
  3. $.when(CallLibrary).then(function (FilesData) {
  4. for (var i = 0; i < FilesData.d.results.length; i++) {
  5.  
  6. var name = FilesData.d.results[i].Name;
  7. var url = FilesData.d.results[i].ServerRelativeUrl;
  8. var newDiv = document.createElement('div');
  9. // Here I show document name and create link to open the sharepoint site
  10. $('#DocName').append("<div><a href='' >" + name + "</a></div>");
  11.  
  12. }
  13. });
  14. }
  15.  
  16. function GetListItems() {
  17. var siteURL = "http://localhost:8032/_api/web/GetFolderByServerRelativeUrl('docList')/Files";
  18. return $.ajax({
  19. url: siteURL,
  20. async: false,
  21. method: "GET",
  22. headers: { "Accept": "application/json;odata=verbose" }
  23. });
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement