This project has moved and is read-only. For the latest updates, please go here.

SP Services Not load

Mar 20, 2012 at 1:48 PM


i was trying to use sp services in my visual web part but it is not working for me. here is my code snippet:

<SharePoint:ScriptLink ID="ScriptLink1" runat="server" Name="JSharepoint/js/jquery.SPServices-0.7.1a.js" Localizable="false"></SharePoint:ScriptLink><SharePoint:ScriptLink ID="ScriptLink2" runat="server" Name="JSharepoint/js/jquery.SPServices-0.7.1a.min.js" Localizable="false"></SharePoint:ScriptLink>

<script type="text/javascript" language="javascript">

   alert('Jquery On....');

    $(document).ready(function () {

     var thisSite = $().SPServices.SPGetCurrentSite(); 

      alert('Hello World! Your site is : ' + thisSite);



when i deploy the page, it only gives me one Alert 'Jquery On'. i checked the URLs are OK. can anybody help ?

Mar 20, 2012 at 2:46 PM
From your example, I don't see you loading jQuery... Looks like you are loading SPServices twice... Are you seeing any javascript errors on the page (start up IE's debugger (F12) prior to refreshing the page, or user FF Firebug).

Another options... Change you first alert to:

alert("is jQuery loaded? " + (jQuery != undefined));

Paul T