Hi all,
The following are my codes: It retrieves information from a site then displays in on my main page.
function HillbillySlider3(sliderList,slideContentField,slideBackgroundImageField, slideTitle) {
//query to retrieve all items
var query = "<Query><Where><Neq><FieldRef Name='ID' /><Value Type='Number'></Value></Neq></Where><OrderBy><FieldRef Name='Created' Ascending='FALSE' /></OrderBy></Query>";
//return fields for slide content and background picture
var camlViewFields = "<ViewFields><FieldRef Name='"+slideTitle+"' /><FieldRef Name='"+slideContentField+"' /><FieldRef Name='"+slideBackgroundImageField+"' /></ViewFields>";
$().SPServices({
operation: "GetListItems",
async: true,
listName: sliderList,
CAMLViewFields: camlViewFields,
CAMLQuery: query,
completefunc: function(xData, Status) {
$(xData.responseXML).SPFilterNode("z:row").each(function() {
var slideContent = ($(this).attr("ows_"+slideContentField));
var slideT = ($(this).attr("ows_"+slideTitle));
var Date = ($(this).attr("ows_"+slideBackgroundImageField));
Date = moment(Date).format('DD MMM');
var res = slideT.split(", ");
$("#linksUL").append("<li><a href='" + res[0] + "' target='_blank'>" + res[1] + "</a></li>");
}); // end completefunc
//start the slider
}
}); // end SPServices call
}
How do I get retrieve it from a subsite???
Thanks in advance!


