It's very easy, you need to declare a "CAMLQuery", "CAMLRowLimit" and "CAMLViewFields" below of "listName", I'll explain this with the next code example:
You can get your CAMLQuery from a view of you list, in sharepoint Designer open a form, I opened the my view list anuncio.aspx and found the next code:
<View Name="your list name">
<Query>
<OrderBy>
<FieldRef Name="Title" Ascending="FALSE"/>
</OrderBy>
</Query>
<ViewFields>
<FieldRef Name="Title"/>
<FieldRef Name="Body"/>
<FieldRef Name="Expires"/>
</ViewFields>
<RowLimit Paged="TRUE">30</RowLimit>
<Toolbar Type="Standard"/>
</View>
Then split the query caml in your JavaScript code depends of your needs or query of your view list,
var fields ="<ViewFields>"+
"<FieldRef Name='Title'/>"+
"<FieldRef Name='Body'/>"+
"<FieldRef Name='Expires'/>"+
"</ViewFields>";
var query = "<Query>"+
"<OrderBy>"+
"<FieldRef Name='Modified' Ascending='FALSE'/>"+
"</OrderBy>"+
"</Query>";
After set the CAMLQuery in the variables, modify your script:
$(document).ready(function() {
$().SPServices({
operation: "GetListItems",
async: false,
listName: "Your List name",
CAMLViewFields: fields,
CAMLQuery: query,
completefunc: function (xData, Status) {
$(xData.responseXML).SPFilterNode("z:row").each(function() {
var liHtml = "<tr> <td>" + $(this).attr("ows_Title") + "</td> </tr>";
$("#tasksUL").append(liHtml);
});
}
});
});
</script>
<table id="tasksUL"/>