0

I am using following list and following jQuery Script to get the list items - but it doesn't work - Does anybody have an idea whats going wrong ?

The alerts are working fine, so the jQuery & SPServices Library are loading: (I am using SharePoint 2013 Enterprise)

[![SP Liste][1]][1]

SP Code

Not working means that the list is not showing/loading. So to get the list I created a new site and add the *.html (with the code above) into the content part (see picture below)

SP_Content

17
  • What is the error? Oct 21, 2015 at 12:47
  • Only thing I see is a space in the CAMLViewFields, which could be an issue Oct 21, 2015 at 12:48
  • Can you describe what "not working" means? Are there errors in your F12 console?
    – Erin L
    Oct 21, 2015 at 12:49
  • Invest time in learning F12 Developer Tools it is going to save you heaps of time. As you are on 2013 you might also be better of with CSR : Client Side Rendering Oct 21, 2015 at 12:55
  • Try inserting an alert inside for.each function() to check if its returning any value or not.
    – 404
    Oct 21, 2015 at 12:56

1 Answer 1

1

Try using below code,

$(document).ready(function()
{
       GetEvents();
});


function GetEvents() {
    $().SPServices({
        debug: true,
        operation: "GetListItems",
        async: false,
        webURL: '/',
        listName: "ListName",
        completefunc: function (xData, Status) {
            $(xData.responseXML).find("[nodeName='z:row']").each(function () {

          /* Your code here  */

            });
        }
    });
}
2
  • THX for your input - with the code line 'webURL' my script is working..
    – SaSH_17
    Oct 21, 2015 at 13:53
  • Would you mark it as an answer then please. Oct 21, 2015 at 13:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.