SharePoint 2013 - SPLessons

Pre Populate User data onto sharepoint form using spservices jquery

Home > > Tutorial
SPLessons 5 Steps, 3 Clicks
5 Steps - 3 Clicks

Pre Populate User data onto sharepoint form using spservices jquery

Pre Populate User data onto sharepoint form using spservices jquery

SPServices is a jQuery library which abstracts SharePoint's Web Services and makes them easier to use. It also includes functions which use the various Web Service operations to provide more useful (and cool) capabilities. It works entirely client side and requires no server install. We can achieve it in two ways. Add these two files in your page
<script src="../SiteAssets/jquery.min.js" type="text/javascript"></script>
<script src="../SiteAssets/jquery.SPServices.min.js" type="text/javascript"></script>
(or)
<SharePoint:ScriptLink language="javascript" name="~sitecollection/Styl\e Library/jquery.min.js" 
Defer="true" runat="server"/>
<SharePoint:ScriptLink language="javascript" Defer="true" runat="server" 
name="~sitecollection/Style Library/jquery.SPServices.min.js" />
The above are two ways of including js files in your master page or any application page that where you want to get current login user details in client side.   First one) The above will get the  current  login user id and the user name, this we  implement in the master page of shaerpoint designer 2013  and you can use this in 2010 also.   Second One) From the above example you will get all  the details of  current login user.