I'm a bit new to spservices, and I hope I'm not asking a question that's already been answered. I've checked and haven't been able to find one like it. I'm using GetListItems to retrieve url's and titles stored in a list. No problems understanding the logic, and it should work. Right now I'm retrieving items and just displaying them in a temporary table.
It works perfectly in a little html page that I've created that references the js files, jquery, etc.
But,
When I set a Content Editor Web Part to point to the html file (using the Content Link), the javascript doesn't work, (or something), and the items aren't displayed. I found out where exactly it stopped working:
$().SPServices({
operation: method,
async: false,
listName: list,
CAMLViewFields: fieldsToRead,
CAMLQuery: query,
completefunc: function (xData, Status) {
alert("When it's in the Content Editor Web Part, this gets called");
$(xData.responseXML).SPFilterNode("z:row").each(function() {
alert("but this does not");
var hyperlink = ($(this).attr("ows_Hyperlink")).split(",");
var url = hyperlink[0];
var description = hyperlink[1];
AddRowToTable(url,description);
});
}
});
As I said before, this code works perfectly when going to the physical address of the html page. It grabs the list items and displays the correct things. The problems occur when I reference, through the Content Link, the html page in the Content Editor Web Part. If anyone has insight on this, it would be most welcome. Thanks, AA
alert(xData.response.XML.xml);orconsole.log(xData.response.XML.xml);and use Developer Tools (F12) – Per Jakobsen Jul 24 '12 at 17:06