on-internet
← Community

get current logged user name & its ID in sharepoint 2010 using jquery

Stack Overflow ·

I am not getting the current user name and id by this method why is anything wrong in it. $().SPServices({ operation: "GetUserInfo", async: false, userLoginName: $().SPServices.SPGetCurrentUser(), completefunc: function (xData, Status) { $(xData.responseXML).find("User").each(function() { curUserId = $(this).attr("ID"); curUserName = $(this).attr("Name"); curFullUserName = $(this).attr("ID")+";#"+$(this).attr("Name"); }); } }); alert(curUserId);

Comments

Sign in or sign up to comment and upvote.

No comments yet.