I have the following code and it does not work. Apparently it's all right. The List name and the URL.
Can anyone help me find the syntax error?
PS: I use Sharepoint Foundation 2010
$().SPServices({
operation: 'GetListItems',
async: false,
listName: 'MyList_Name',
webURL: 'http://domain.com/',
CAMLViewFields: '<ViewFields>'+
'<FieldRef Name="NamePage" />'+
'<FieldRef Name="Date" />'+
'<FieldRef Name="Title" />'+
'<ViewFields>',
CAMLQuery: "<Query><OrderBy><FieldRef Name='Date' Ascending='FALSE'></OrderBy></Query>",
completefunc: function (xData, Status){
htmlReturn += '<div class="coluns">';
$(xData.responseXML).SPFilterNode('z:row').each(function() {
var Title = $(this).attr('ows_Title'),
Date = $(this).attr('ows_Date'),
NamePage = $(this).attr('ows_NamePage');
if(aux <= 6){
htmlReturn += '<ul>'+
'<li class="date">'+Date+'</li>'+
'<li><a href="'+NamePage+'.aspx">'+Title+'</a></li>'+
'</ul>';
aux++;
}
});
htmlReturn+= '</div>';
if(htmlReturn != ''){
$('.Result').html(htmlReturn);
}else{
$('.Result').html('');
}
}
});