javascript - Problem in getting the parseInt(data) return NaN -
i having peculiar problem getting integer ajax response. whenever call following code, parseint(data) returns nan despite data being string.
function(data) //return information jquery's request { $('#progress_container').fadein(100); //fade in progress bar $('#progress_bar').width(data +"%"); //set width of progress bar based on $status value (set @ top of page) $('#progress_completed').html(parseint(data) +"%"); //display % completed within progress bar }
from looks of line:
$('#progress_completed').html(parseint(data) +"%");
it seems trying insert percentage html #progress_completed element. mentioned data
string, why converting integer concatenating string (the % string)?
parseint(data) + "%"
this statement above creates string. if data
string, need be:
$('#progress_completed').html(data +"%");
i'd suggest adding console.log(data) check value of data first sure.
Comments
Post a Comment