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 shows error
java.lang.NoClassDefFoundEr

View Tutorial          By: vamsi at 2010-05-14 23:09:03

2. Good work, IT really help me a lot;
View Tutorial          By: TUSHAR at 2010-02-03 01:25:37

3. This site is sufficient for learning the programmi
View Tutorial          By: Shaheryar Khlaid at 2011-07-25 20:36:01

4. I've been satisfied with your tutorial site. Since
View Tutorial          By: Mark Harold F. Manguino at 2008-08-06 05:00:54

5. very good tutorial..
View Tutorial          By: shobhit at 2010-05-04 12:17:41

6. Very nice article.. thanks
View Tutorial          By: Basu at 2010-05-29 05:52:00

7. yes. Client needs to use printwriter, especially w
View Tutorial          By: Aksh at 2011-07-06 03:30:46

8. really nice
View Tutorial          By: umer at 2011-06-25 06:35:19

9. Good one
View Tutorial          By: Ravi at 2007-11-19 03:30:40

10. the spinner example is very nice...
View Tutorial          By: narendra at 2011-11-23 11:16:47