query is just a string which contains the CAML we're using to tell GetListItems what to fetch for us, so what you see there is right.
In the SPServices call, you're not passing in the CAMLQuery:
In the SPServices call, you're not passing in the CAMLQuery:
$().SPServices({ operation: "GetListItems", listName: "Opportunities", CAMLQuery: query, async: false, completefunc: function(xData, Status) { itemCount = $(xData.responseXML).SPFilterNode("rs:data").attr("ItemCount"); } });