Solved

spservices, jquery

Posted on 2013-05-17
2
409 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Got endorsements from your clients?  Great!  There is almost nothing better than word-of-mouth advertising.  But how can you do that on the internet?  Sure you can make a page for endorsement quotations and list them all, but who is …
How to build a simple, quick and effective accordion menu using just 15 lines of jQuery and 2 css classes
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)
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

810 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