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

SP services is not null or not an object

Mar 20, 2013 at 7:03 PM
I keep getting this error and unable to resolve this. And I have already spent days on Google and trying to fix but all in vain.
I tried the absolute and relative URL references. and references seems to be fine.
Tried using content editor webpart
Saved the script files in the library on the same site and have all the access permissions.
I tried the same thing on other machine and everything is working fine. But I guess something is wrong with Sharepoint environement or something to do with my machine setting or network policies I don't know.

Does anyone out there know how to fix this or possible solution could be?

Help is much appreciated.
Mar 20, 2013 at 7:39 PM
"SP services is not null or not an object" means that your reference to the script file isn't correct. Even though you've checked them, check them again.

Look at this post for some hints:

There's also information at the bottom of the first documentation page.

Mar 21, 2013 at 4:35 PM
Thanks for the reply.

I tried to follow the link.

I got the jquery alert message but did not get the any alert from SPservice Reference. I also did not get any messages like 'undefined' or any value which makes no sense.

When Page is loaded, I see the same error on bottom left of IE. 'SPServices' is null or not an object.

Can you please suggest me something else which I can get this thing done.
I appreciate your time.
Mar 21, 2013 at 4:47 PM
Edited Mar 21, 2013 at 4:48 PM
Can you post the code where you are referencing the files?

Mar 21, 2013 at 4:56 PM
<script language="javascript" type="text/javascript" src="../../Scripts/jquery-1.6.2.min.js"></script>
<script language="javascript" type="text/javascript" src="../../Scripts/jquery.SPServices-0.7.2.js"></script>
<script language="javascript" type="text/javascript"> $(document).ready(function() { alert("jQuery"); alert($().SPServices.SPGetCurrentSite()); }); /* $(document).ready(function() { $().SPServices.SPCascadeDropdowns({ relationshipList: "ProjectTypeProjectName", relationshipListParentColumn: "ProjectType", relationshipListChildColumn: "ProjectTitle", parentColumn: "ProjectType", childColumn: "ProjectName", debug: true }); }); */ </script>
Mar 21, 2013 at 5:11 PM
OK, so this says that you have both the jQuery library and SPServices stored up two layers from the current location. I would always suggest using a relative path from the root site, so for example:


If the jQuery alert is happening and the SPServices one isn't, then that reference must not be correct. Are you sure you are storing both files in the same place?

BTW, I would suggest using jQuery 1.8.3.

Mar 21, 2013 at 5:16 PM
I tried the relative path too and also both files are under same library. It keeps giving me the same error.

These two versions are compatible and working fine on my other machine.

I am wondering if I had to do anything with the machine I am getting this error.

Is there a possibility that network policies or proxy setting or something would be a cause to this error.
Mar 21, 2013 at 5:27 PM
Probably not. You could try looking at the network traffic with Firebug or Fiddler to see if you are getting an error loading the file.

Mar 21, 2013 at 5:49 PM
Tried that too. I used firebug.

Error message in console is "Uncaught typeError: Cannot call method 'SPGetCurrentSite' of undefined"
Mar 21, 2013 at 6:18 PM
I meant to look at the Net traffic to see if the SPServices file is actually fetched successfully.

Mar 28, 2013 at 6:33 PM
After more than 10 days of struggle I was able to find the solution.. well I don't know but the problem is solved with the help of my friend.

We tried many things but finally did nothing much but changed scripts to jquery-1.8.2.js and jquery.SPServices-0.7.2.min.js . It is working fine now.

Here, take a look at this working script.

<script src="/Scripts/jquery-1.8.2.js" type="text/javascript"></script><script src="/Scripts/jquery.SPServices-0.7.2.min.js" type="text/javascript"></script><script type="text/javascript">



Hope this helps someone.

Sympmarac, thanks for responding quickly. I appreciate your effort and time. :)
Mar 28, 2013 at 9:20 PM
It had to be that your file references weren't right. Note that your paths are different in what you ended up with.

Anyway, glad that you solved it.