Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SP.SOD.executeFunc('sp.js', 'SP.ClientContext',
- function (){
- //your code goes here...
- alert('script loaded');
- var context = new SP.ClientContext.get_current();
- var user = context.get_web().get_currentUser();
- });
- ExecuteOrDelayUntilScriptLoaded(init, "sp.js");
- function init()
- {
- this.clientContext = new SP.ClientContext.get_current();
- this.oWeb = clientContext.get_web();
- currentUser = this.oWeb.get_currentUser();
- this.clientContext.load(currentUser);
- this.clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement