using SPServices in SP Foundation 2010 - Not working for me

Sep 1, 2010 at 7:12 AM

I tried using the below  in a SP Foundation site.I added this to a Content Editor Webpart
I can see the alert('hello'); work.
Any ideas what 'm doing wrong?
Thanks in Advance

<script src="../jQueryLibraries/jquery-1.4.2.min.js" type="text/javascript"></script>

<script src="../jQueryLibraries/jquery.SPServices-0.5.4.min.js" type="text/javascript"></script><script language="javascript" type="text/javascript">

$(document).ready(function() {
alert('hello');
  $().SPServices({
    operation: "GetListItems",
    async: false,
    listName: "Announcements",
    CAMLViewFields: "<ViewFields><FieldRef Name='Title' /></ViewFields>",
    completefunc: function (xData, Status) {
      $(xData.responseXML).find("[nodeName=z:row]").each(function() {
        var liHtml = "<li>" + $(this).attr("ows_Title") + "</li>";
        $("#tasksUL").append(liHtml);
      });
    }
  });
});</script><ul id="tasksUL"></ul>

Coordinator
Sep 1, 2010 at 7:17 AM

naijacoder:

What's happening? Are you getting an error? No results where you would expect some?

M.

Sep 1, 2010 at 7:19 AM

Sorry sympmarc
the error i get is

"object doesn't support this property or method"

Coordinator
Sep 1, 2010 at 7:24 AM

I don't see anything obvious. The first thing I would check is that the reference to SPServices is valid.

M.

Sep 1, 2010 at 7:34 AM

should i move the file jquery.SPServices-0.5.4.min.js from document lib to _layouts folder..
I'm sure its there as the jquery file is in the same document lib

Coordinator
Sep 1, 2010 at 7:37 AM
Edited Sep 1, 2010 at 7:37 AM

No, it can sit where it is. Debugging time!

M.

Sep 1, 2010 at 7:45 AM

Marc how can i debug.
Have you tested it with SPF 2010.
Did it work.
I moved the files to the layouts folder with no luck.
I want to use SP services to create  TOP navigation so i want to pull data from a list and display it as menu.
Hope i will get there:(
Let me know i'll do some testing here too

Coordinator
Sep 1, 2010 at 7:58 AM

If you look through the docs, you'll see what I've explicitly tested with SP2010 by the use of the icons. I'm certain that GetListItems will work with SP2010.

If you're going to be using the Web Services like this, you're going to have to get used to debugging on your own. Use the Developer Tools in IE8 or Firebug with Firefox.

M.

Sep 1, 2010 at 8:13 AM

is there anything i can add like alert('sdsd'); to test if the SPServices is working?
Can't remember but i think io read about Debug:true or something similar...

Thanks

Coordinator
Sep 1, 2010 at 5:47 PM

Debug mode is only there for the "value-added" functions in SPServices.

M.