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. class Evaluate
{
public static void

View Tutorial          By: prajjawal at 2013-02-27 12:36:58

2. hi plz help
how do we change project develo

View Tutorial          By: pratik jogwar at 2012-06-07 19:58:47

3. how do i write the above same code using ajax and
View Tutorial          By: Karthik at 2011-08-29 11:21:45

4. Java s ssssss
View Tutorial          By: zoya at 2012-04-27 12:24:59

5. if i wanna push the data from my keyboard input, h
View Tutorial          By: andys at 2008-11-09 03:09:32

6. I am using my samsung s5233 via usb connection, ru
View Tutorial          By: Puneet at 2010-04-23 06:14:28

7. Sometimes java do support operator overloading as
View Tutorial          By: Gunjan Srivastava at 2011-07-06 09:14:00

8. 27: What happens if the producer and the customer
View Tutorial          By: Spender at 2010-07-25 14:42:08

9. hi every body i want full java code to send messag
View Tutorial          By: Ashray P Shetty at 2010-11-09 04:33:45

10. Brief but Comprehensive. Excellent Effort.
View Tutorial          By: Farooq at 2011-11-16 14:14:52