How do I go about getting the client username with the javascript client object model? I can't find anything helpful in microsoft's documentation, it's awful :|
1 Answer
var ctx = new SP.ClientContext();
var user = ctx.get_web().get_currentUser();
ctx.load(user);
ctx.executeQueryAsync(function() {
console.log(user);
});
-
Slightly different approach than what @vedran-rasol did in sharepoint.stackexchange.com/questions/20802/…eirikb– eirikb2012-09-14 13:07:26 +00:00Commented Sep 14, 2012 at 13:07