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. Nice one for jsp learners.
View Tutorial          By: Vignesh at 2011-07-14 04:04:55

2. Hi i 've used this SMSClient.java in my simple pro
View Tutorial          By: Prakah at 2011-12-22 17:10:48

3. Nice Example .........than Q!!!
View Tutorial          By: Sreekar at 2011-06-29 15:31:50

4. thanks,Gud job
View Tutorial          By: junaid sheikh at 2012-11-21 16:24:27

5. Dear All, I am getting the following exception for
View Tutorial          By: Protik Basu at 2008-10-31 05:30:36

6. Out of -1, 0, and 1 which one can I use as second
View Tutorial          By: Sanjay Bhosale at 2011-12-06 13:17:54

7. Very good description. I was quite confused before
View Tutorial          By: Donna at 2011-07-31 03:46:05

8. Thanks !
View Tutorial          By: Swaran at 2010-02-02 23:50:13

9. Hello, I have executed the above code and it works
View Tutorial          By: Sana at 2010-02-01 03:49:44

10. hi,
there is no main method in SMSClient.ja

View Tutorial          By: raju at 2010-01-22 08:28:45