Solved

spservices, jquery

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Debugging step-by-step Jquery/Javascript 6 57
How can I   ajax html table  rows? 20 60
angular2 2 way binding on load 7 38
alert before form submission 6 27
This article discusses how to create an extensible mechanism for linked drop downs.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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)

919 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