Hi Marc,
I'm loving the library - this is an awesome piece of kit to use in Sharepoint! I do have a question though, about how to get the GetAlerts web service to work in a demo:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script> <script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery.SPServices/0.7.1a/jquery.SPServices-0.7.1a.min.js"></script> <script type="text/javascript"> var divId = "#WSOutput"; var out = ""; // main function $().ready(function () { var theList = ""; $().SPServices({ operation: "GetAlerts", async: false, webUrl: "<server url>", //name removed for post completefunc: function (xData, Status) { $(divId).append("<b>This is the output from the GetAlerts operation:</b><br>"); var out = $().SPServices.SPDebugXMLHttpResult({ node: xData.responseXML, outputId: divId }); $(divId).append(out); $(xData.responseXML).find("Alerts > Alert").each(function() { var exist = $(this).attr("Id"); if (exist == "" ){ alert("No alerts for this site"); } else { theList = $(this).attr("Title"); var theURL = $(this).attr("AlertForUrl"); var theGUID = $(this).attr("Id"); var Row = "Title: " + theList +" - " + theURL + " - " + theGUID; $(divId).append(Row); } }); //each $(divId).append(out); } }); }); </script> <div id="WSOutput"></div>
I'm struggling to see what I'm doing wrong on this - every time I use the above demo, I get back the SOAP response to indicate there is an alert set on the site (which is the case), but when trying to get back inidividual responses, all I get back is "undefined". The above code is a variation from http://spservices.codeplex.com/discussions/287523, allowing for any comments made after the original post.
I've tried changing the location of the variables that are defined, to ensure this is not simply down to not declaring them at the right time; it hasn't made any difference. Could some please point me in the right direction?
Cheers,
Alex.