SHARE
TWEET

Untitled

a guest Jul 16th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SP.SOD.executeFunc('sp.js', 'SP.ClientContext',
  2. function (){
  3.  //your code goes here...
  4.  alert('script loaded');
  5.       var context = new SP.ClientContext.get_current();
  6.      var user = context.get_web().get_currentUser();
  7. });
  8.      
  9. ExecuteOrDelayUntilScriptLoaded(init, "sp.js");
  10.  
  11. function init()
  12. {
  13.             this.clientContext = new SP.ClientContext.get_current();
  14.             this.oWeb = clientContext.get_web();
  15.             currentUser = this.oWeb.get_currentUser();
  16.             this.clientContext.load(currentUser);
  17.             this.clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
  18.  
  19. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top