json - javascript $.post returning correct result but cant catch all characters in returned string -
i using $.post write result database.
my syntax is:
$.post('addbundle_summary', {id:id},function(resultsummary) { alert(resultsummary[0]); }) i using codeigniter , in model returning result below. note sql returns single result $stackid single number:
return $stackid; my controller send function with:
$this->output->set_content_type('application/json')->set_output(json_encode($data)); in developer tools, can see result function per below image 
even though result 23, alert showinf me 2. if result 573 alert 5.
how can return entire result number , not first letter of string?
alert(resultsummary[0]) returning resultsummary string @ index 0, 2. use alert(resultsummary) instead.
$.post('addbundle_summary', {id:id},function(resultsummary) { alert(resultsummary); })
Comments
Post a Comment