Quantcast
Channel: jQuery Library for SharePoint Web Services
Viewing all articles
Browse latest Browse all 6517

New Post: Using SPServices for SharePoint Online

$
0
0
Hi Marc,

Thanks so much for the response. I'm sure I'm overlooking something very simple, but even adding the document.ready doesn't seem to solve the issue. Here is a screen shot of the code example when editing.

Image

Here is the same page after it has been saved/checked in.

Image

Here is my example with the document.ready added.

Are there any permission settings that might be affecting me?
<script src="https://<hostname>.sharepoint.com/teams/multimedia/Home2014Assets/jquery-1.10.2.min.js"></script>
<script src="https://<hostname>.sharepoint.com/teams/multimedia/Home2014Assets/jquery.SPServices-2013.01.min.js"></script>

<div style="background-color:#a80000;color:#fff;" id="currentUserDIV">Your name is: </div>

<script>
function goGetCurrentUserForTasks() {
    userName = $().SPServices.SPGetCurrentUser({
        fieldName: "Title"
    });
    // Add Username to tasks
    $("#currentUserDIV").append(userName);
}

// Check if dom is loaded
$(document).ready(function() {
    goGetCurrentUserForTasks();
}); // End document ready
</script>
Thanks again,
Carl

Viewing all articles
Browse latest Browse all 6517

Trending Articles