Current User Display Name
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Hi Stu,
Please, use the code:
Please, use the code:
Code: Select all
SP.SOD.executeOrDelayUntilScriptLoaded((function () {
var ctx = new SP.ClientContext.get_current();
var web = ctx.get_web();
ctx.load(web);
var user = web.get_currentUser();
user.retrieve();
ctx.executeQueryAsync(
function () {
alert(user.get_title());
});
}), "SP.js");
-
- Information
-
Who is online
Users browsing this forum: No registered users and 6 guests