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. thanx it i very helpful 4 me as i m new with java
View Tutorial          By: akminder at 2011-08-09 05:09:19

2. abstract class Explain the concept of abstract c
View Tutorial          By: rahul at 2012-02-23 08:30:47

3. i installed the code in ecllipse,but i have one do
View Tutorial          By: vamsi at 2015-05-19 10:56:25

4. ans to 23:
by using gdb(GNU deb

View Tutorial          By: Bhargav at 2011-11-02 13:23:51

5. the above is perfect, but when i hit the export bu
View Tutorial          By: CH at 2009-06-02 03:01:34

6. Hi
I am newly in java. I have one dought. I

View Tutorial          By: Saman at 2010-08-03 20:34:38

7. I have writtent this code in my jdbc program,

View Tutorial          By: yeshdeep kumar at 2014-11-12 07:46:46

8. I have compiled by keeping all the points in mind
View Tutorial          By: Sweety at 2011-03-09 22:29:18

9. Good information...it help me to do mi projecto! t
View Tutorial          By: gnk at 2010-08-12 01:01:50

10. Good intro..
View Tutorial          By: thirunavukkarasu at 2015-01-30 17:32:10