Search code examples
javascriptjquerysharepoint-2010spservices

SPServices GetCurrentUser write variable into div


I don't know JavaScript but I need to use SPServices on my company intranet. I need to write the fieldNames into some divs on my page, how do I do this? Here's the SPServices script:

<script type="text/javascript">
$( document ).ready(function(){
var thisUsersValues = $().SPServices.SPGetCurrentUser({
fieldNames: ["FirstName", "LastName", "Picture", "JobTitle", "WorkPhone", "WebSite",],
debug: false
});
</sript>

Thanks!


Solution

  • Maybe this could help you :

    var $userDescription = "<div>"+ thisUsersValues.toString() +"</div>";
    $("#yourDivID").append($userDescription);