I'm calling listdata.svc a few times with different URL's depending in what is selected, I have some issues with the parameters/filters.
First URL:
var listUrl = siteUrl + "_vti_bin/ListData.svc/Pages?$filter=ApprovalStatus eq '0'&top=2&orderby=Modified desc";
This one only get items that are approved but it ignores the top and orderby, what am I doing wrong here? I've tried with various combos of moving the parameters around ,use &$ etc.
Second URL:
var listUrl = siteUrl + "_vti_bin/ListData.svc/Pages?$filter=substringof('" + keyword + "',Keywords)";
This one works but I can't get it to only get items with the keywords AND are published, ordered by Modified.
Third URL:
var listUrl = siteUrl + "_vti_bin/ListData.svc/Pages?$filter=ApprovalStatus eq '0'&$skip=" + displayedItems + "&top=1";
This one get only approved items but ignores skip and top.
Any suggestions?
Thanks in advance.\
Update: Looks like:
$.getJSON(listUrl,
function (data) {
$.each(data.d.results,
function (i, result) {
causes the error when I use &$top in the URL..
Edit2:
Ok so when I use top I have to do $.each(data.d,
instead of $.each(data.d.result,
$
: $orderby, $skip, $top