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



Related Tutorials

Java program to get location meta data from an image

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

Archived Comments

1. i was told to write a class which wl work as Strin
View Tutorial          By: ireen at 2011-04-13 04:59:31

2. its very useful......to me
View Tutorial          By: dinesh at 2014-08-26 12:47:38

3. why 27's example is prone to a deadlock ? when pro
View Tutorial          By: kaka at 2011-08-14 00:59:41

4. thanks ..it was really helpful.
View Tutorial          By: jay at 2012-03-19 04:17:14

5. really helpul........
pls mail me some more

View Tutorial          By: shivani at 2010-07-17 01:47:30

6. Thanks so much for the tutorial!! Was extremely us
View Tutorial          By: Debarupa at 2012-05-10 20:23:28

7. I want to send a message using mobile browser to s
View Tutorial          By: Richa Bhatia at 2009-12-08 22:33:36

8. what's the deffrint between "String[] [] Arra
View Tutorial          By: ahmad at 2009-08-24 03:01:11

9. Can anybody tell.... what if condition is doing in
View Tutorial          By: Randhir Sambyal at 2013-08-26 06:37:25

10. I was trying to copy your coding and execute it, b
View Tutorial          By: Guest at 2012-01-02 04:08:21