here is the code Im using, which essentially is a copy/paste of the code provided:
<script language="javascript" type="text/javascript">
$(document).ready(function() {
completefunc: function( xData, Status ) {
var $xData = $(xData.responseXML),
itemTotal = 0,
totalComplete = 0,
percentage = 0
;
itemTotal = $xData.SPFilterNode("rs:data").attr("ItemCount") * 1;
$xData.SPFilternode("z:row").each(function(i, el) {
var $node = $(this)
;
if ( $node.attr("PM_Value") === "Complete" ) { //This is the display name for the column. The field reference name is "PM%5FValue"
totalComplete++;
}
}
if ( itemTotal !== 0 ) {
percentage = totalComplete / itemTotal;
}
alert("Total items: " + itemTotal);
alert("Percentage complete: " + percentage);
}
});
</script>