Thursday, 3 July 2014

How to get current user with javascript?

_spPageContextInfo

Above object will give all user related information.
User Name:_spPageContextInfo.userLoginName
SharePoint version number: _spPageContextInfo.webUIVersion