Take the 2-minute tour ×  I have a SharePoint 2010 web site with
a master page that has a counter on it. I'm trying to update
that counter using the ECMAScript. The code I have falls nicely
into the success method - but I cannot find the right call to
get a count. I have tried length, length(), count & count().
Does anybody have any suggestions? I have the code working, but
only by enumerating through the results of the list and
incrementing a count.  This is what I have so far, as an
example:-  <script type="text/javascript">     var clientContext
= null;     var web = null;
ExecuteOrDelayUntilScriptLoaded(Initialize, "sp.js");
function Initialize()         clientContext = new
SP.ClientContext.get_current();         web =
clientContext.get_web();         var list =
web.get_lists().getByTitle("Absences");         var camlQuery =
new SP.CamlQuery();         var q = "<Where><Eq><FieldRef
Name='StatusID' /><Value Type='Integer'>1</Value></Eq></Where>";
this.listItems = list.getItems(camlQuery);