Tag Info

Hot answers tagged

2

I'm using this: <script type="text/javascript"> var loginName = ""; var userid = _spPageContextInfo.userId; GetCurrentUser(); function GetCurrentUser() { var requestUri = _spPageContextInfo.webAbsoluteUrl + "/_api/web/getuserbyid(" + userid + ")"; var requestHeaders = { "accept" : "application/json;odata=verbose" }; $.ajax({ url : requestUri, ...


1

The Html file is being used by Design Manager, and created as when you activate Publishing Infrastructure Feature. Html file doesn't come with team sites template. Update after your comment: It is something that you should decide at top level site of a new Site Collection, whether or not the publishing feature will be needed within that Site Collection ...


1

JavaScript Object Model can be very easily used to get the current user. // Getting current user detail function getCurrentUser() { try { var clientContext = new SP.ClientContext.get_current(); var tempcurrentUser = clientContext.get_web().get_currentUser(); clientContext.load(tempcurrentUser); ...


1

Code given in the below link demonstrates how to get the current user name by using simple CSOM, http://www.enjoysharepoint.com/Articles/Details/get-current-logged-in-username-in-sharepoint-2013-using-javascript-20982.aspx



Only top voted, non community-wiki answers of a minimum length are eligible