Stepping in to SPServices - GetUserInfo

Mar 8, 2012 at 11:23 AM


I want to get to grips with the more advanced possibilities available with SPServices.

The best way for me to learn anything has been to make something complex work so as to learn how each indiviual part has functioned and so give me a range tools when looking at problems.

For instance I'd like to get the example from $.SPServices documentation that users GetUserInfo to work. LINK

Now I'll be honest I have copied the code into a html file linked by a CEWP. The code is wrapped in the standard (document).ready and the libaries are linked with another linked CEWP further up in the page.

I used the .SPGetCurrentUser and got results but nothing is happening at all with that example.

Is the example still valid?

How would one go about populating GetUserInfo with current user information? Would you some how use .SPGetCurrentUser or would you use something like the large example at the bottom of the page here.


Mar 8, 2012 at 4:18 PM

If you copied the example verbatim, it may not work. what it does is put the results into a container with an id="WSOutput". You need to have a container in trhe page with that id to see any results.

Obviously, you also need to specify a user that exists in your environment.