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

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. /* File name : Employee.java */
public abst

View Tutorial          By: Anonymous at 2012-11-16 12:23:17

2. hi guys,

i want some

View Tutorial          By: THANGA at 2012-03-19 15:24:38

3. very thanks... It's very useful to me...
Th

View Tutorial          By: swathi. M at 2015-01-02 16:32:19

4. thnks lot 4 helping me
View Tutorial          By: sandeep dudi at 2011-11-17 06:06:03

5. Great!
Thnks for your help..

View Tutorial          By: ramu at 2011-06-18 07:56:56

6. Hi, I tried this code to send sms from my PC which
View Tutorial          By: Jothi at 2009-05-15 03:19:54

7. Awesome............
View Tutorial          By: Amol at 2011-06-11 05:32:49

8. very good description ,clear and simple
View Tutorial          By: swapnil at 2011-06-24 06:33:10

9. Can u tell me more about struts related to databas
View Tutorial          By: archana at 2010-09-15 04:38:54

10. Hey Narayanan, maybe you should check out Vesijama
View Tutorial          By: Benny Bottema at 2009-05-03 14:27:07