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. You have simply saved my life. After 2 days dealin
View Tutorial          By: M├írio Buratto at 2013-01-11 19:54:36

2. Very good. but why i can search data then report v
View Tutorial          By: ARMAN AHMED at 2015-04-27 13:18:04

3. this pionter is used to help compiler to understan
View Tutorial          By: RUB NAWAZ at 2008-10-31 11:38:09

4. Here is my issue. The sql which comes thru the JTD
View Tutorial          By: Kumar at 2012-02-21 02:42:08

5. This is very simple code and very much understanda
View Tutorial          By: Prem Anand at 2013-05-04 11:21:16

6. nice
View Tutorial          By: aish at 2011-05-06 07:30:09

7. Assalamu alaikum saaliya sir,

Could

View Tutorial          By: Jaffer sulaiman at 2014-08-23 06:01:20

8. i want to study c-programming language
View Tutorial          By: rajesh at 2008-07-27 07:43:09

9. just I am need of some of the soft copy related to
View Tutorial          By: shani at 2015-08-12 06:01:05

10. My question is, from where the name "java&quo
View Tutorial          By: Sreedevi at 2013-05-18 10:41:38