i want to get the current logged in user:
var ctx = SP.ClientContext.get_current();
this.web = ctx.get_web();
this.currentUser = web.get_currentUser();
ctx.load(this.currentUser);
alert(this.currenUser.get_loginName());
but the current user is always null ---> what im doing wrong?