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 enter image description here

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

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -