Comment on Tutorial - Using parseInt() and parseFloat() in JavaScript to convert data types to Numbers By Nicholas C. Zakas



Comment Added by : mehr

Comment Added at : 2011-05-11 10:22:46

Comment on Tutorial : Using parseInt() and parseFloat() in JavaScript to convert data types to Numbers By Nicholas C. Zakas
Hey,

I am having a peculiar problem with getting an integer from an ajax response. Whenever I call the following code, parseInt(data) returns NaN despite data being a string.
function(data) //return information back from jQuery's get request
{

$('#progress_container').fadeIn(100); //fade in progress bar
$('#progress_bar').width(data +"%"); //set width of progress bar based on the $status value (set at the top of this page)
$('#progress_completed').html(parseInt(data) +"%"); //display the % completed within the progress bar
}


View Tutorial



Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. it is really best site for the information.many ti
View Tutorial          By: panchanan ruata at 2013-05-22 09:36:37

2. hi i am new to JSP wht is class.forname in the cod
View Tutorial          By: chanti at 2011-05-07 03:02:26

3. article is good but I would have liked to get more
View Tutorial          By: Bharat Agrawal at 2010-09-25 22:18:40

4. hi,i am new in java..plz send me java programmes i
View Tutorial          By: dinesh at 2012-12-30 15:58:31

5. HI, like some guys in this tutorial I get this pro
View Tutorial          By: omar carpio at 2009-09-06 13:17:37

6. good one
View Tutorial          By: thyagesh at 2011-12-06 05:06:27

7. Hi,
I am getting this exception..My modem i

View Tutorial          By: divya at 2008-04-27 04:12:19

8. thank you very much
finally i understood th

View Tutorial          By: Marina at 2009-11-29 14:17:43

9. this code runs permanently!!! created by diko(Turk
View Tutorial          By: ali at 2013-08-12 07:56:01

10. very useful. Thx
View Tutorial          By: reddy at 2015-05-07 09:58:19