Wednesday, 20 February 2013

How to get username from JQuery

 
Use below Jquery to get the Current User name
var thisUserAccount = $().SPServices.SPGetCurrentUser({
                fieldName: "Title",
                debug: false
});
Use below code to get the ID for Current User
var thisUserAccount = $().SPServices.SPGetCurrentUser({
                fieldName: "ID",
                debug: false
});
Use below code to get the LoginName for Current User
var thisUserAccount = $().SPServices.SPGetCurrentUser({
                fieldName: "Name",
                debug: false
});