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 all,

Could you point me to any documentation about using spservices in SharePoint Online?

My specific question (apologies if this is already posted elsewhere) is the proper way to use the library in this environment. So far, I have done the following:
  1. Added jquery-1.10.2.min.js and jquery.SPServices-2013.01.min.js to a document library.
  2. Using a Script Editor web part I am performing a simple test.
<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);
}
goGetCurrentUserForTasks() ;
</script>
  1. It works just fine, while in edit mode. However, when I save/publish the page the spservices call (the username in this case) disappears.
Many thanks for the advice. Spservices is a great library! I have used it quite a bit in the on-premise version of SharePoint. I'm just trying to learn the proper way to use it in the hosted version.

Viewing all articles
Browse latest Browse all 6517

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>