Solved

spservices, jquery

Posted on 2013-05-17
2
405 Views
Last Modified: 2013-05-17
Can somebody please help with understand what this line means in the code below:
var var numRecords = parseInt($(xData.responseXML).SPFilterNode('rs:data').attr('ItemCount'), 10);


I know it's doing some type of count but what is the ",10" for? Thx!

 $().SPServices({
		operation: "GetListItems",
		async: false,
		listName: "Site_Projection",
		CAMLViewFields: "<ViewFields><FieldRef Name='"+sourceTypeLower+"P<wbr ></wbr><wbr ></wbr>rojectedDa<wbr ></wbr>te'></Fiel<wbr ></wbr>dRef></Vie<wbr ></wbr>wFields>",<wbr ></wbr>     
		CAMLQuery: "<Query><Where><And><Eq><F<wbr ></wbr><wbr ></wbr>ieldRef Name='ProgramName' /><Value Type='Lookup'>"+ programName + "</Value></Eq><And><Geq><F<wbr ></wbr><wbr ></wbr>ieldRef Name='"+TypeLower+"P<wbr ></wbr><wbr ></wbr>rojectedDa<wbr ></wbr>te' /><Value Type='DateTime'>" + beginFY + "</Value></Geq><Leq><Field<wbr ></wbr><wbr ></wbr>Ref Name='"+TypeLower+"P<wbr ></wbr><wbr ></wbr>rojectedDa<wbr ></wbr>te' /><Value Type='DateTime'>" + endFY + "</Value></Leq></And></And<wbr ></wbr><wbr ></wbr>></Where><<wbr ></wbr>/Query>",
		completefunc: function (xData, Status) {			
			var numRecords = parseInt($(xData.responseX<wbr ></wbr><wbr ></wbr>ML).SPFilt<wbr ></wbr>erNode('rs<wbr ></wbr>:data').at<wbr ></wbr>tr('ItemCo<wbr ></wbr>unt'), 10);

Open in new window

0
Comment
Question by:Isaac
2 Comments
 
LVL 23

Accepted Solution

by:
Ioannis Paraskevopoulos earned 250 total points
ID: 39175434
Hi,

Check this: http://www.w3schools.com/jsref/jsref_parseint.asp

10 says that the string returned by $(xData.responseXML).SPFilterNode('rs:data').attr('ItemCount') is a decimal.

Giannis
0
 
LVL 44

Assisted Solution

by:Rainer Jeschor
Rainer Jeschor earned 250 total points
ID: 39175438
Hi.
the 10 is the base number format == decimal.
parseint(11,2) would be 3
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now