//Get current context
var ctx = new SP.ClientContext.get_current();
//Get other site (web) context
var ctx = new SP.ClientContext("/othersite/");
//Get web
var web = ctx.get_web();
//Get current page ID in Pages library
var pageID = SP.PageContextInfo.get_pageItemId();
//Get current user
var user = ctx.get_web().get_currentUser();
user.retrieve();
var userlogin = user.get_loginName();
Related Content
SharePoint JavaScript Client Object Model why not
SharePoint 2013 Script Editor and Embed Code
SharePoint 2013 JavaScript Add List with Columns
Ingen kommentarer:
Send en kommentar