Advertisement
Guest User

Untitled

a guest
Oct 26th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. function loadConstants() {
  2. var ctx = new SP.ClientContext.get_current();
  3. this.site = ctx.get_site();
  4. ctx.load(this.site );
  5. this.web = ctx.get_web();
  6. var list = web.get_lists().getByTitle('VGuardWebMethodList');
  7. ctx.load(this.web);
  8. ctx.executeQueryAsync(Function.createDelegate(this, this.onSuccess),
  9. Function.createDelegate(this, this.onFail));
  10. }
  11.  
  12. function onSuccess(sender, args) {
  13.  
  14. IPC_siteUrl = this.site.get_url();
  15. alert(IPC_siteUrl );
  16. IPC_siteId = this.site.get_id();
  17. alert(IPC_siteId );
  18. }
  19. function onFail(sender, args) {
  20. console.log(args.get_message());
  21. }
  22. function callWebServiceMethodAjaxTest() {
  23. $j.ajax({
  24. type: "GET",
  25. cache: false,
  26. url: methodUrl,
  27. contentType: "application/json",
  28. dataType: 'json',
  29. beforeSend: function () { },
  30. complete: function () { },
  31. error: function (xhr, status, errorThrown) {
  32. alert(errorThrown);
  33. },
  34. success: function (result) {
  35. alert(result.d);
  36. }
  37. });
  38. }
  39. </script> ​​
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement