How to assign javascript variable in a php variable inside javascript function - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: How to assign javascript variable in a php variable inside javascript function (/showthread.php?tid=52763) |
How to assign javascript variable in a php variable inside javascript function - El Forum - 06-25-2012 [eluser]Shiju S S[/eluser] I have a script with code Code: var fcontent=new Array(); $c_purpose is a php array. I want the array contents to be stored in the javascript array fcontent. $i is not incrementing. What is the solution. How to assign javascript variable in a php variable inside javascript function - El Forum - 06-25-2012 [eluser]InsiteFX[/eluser] Try this: Code: fcontent[j]="<?php echo $c_purpose[$i]; ?>"; How to assign javascript variable in a php variable inside javascript function - El Forum - 06-26-2012 [eluser]Shiju S S[/eluser] It is not working. I tried Code: fcontent[j]="<?php echo $c_purpose[$i]; ?>"; How to assign javascript variable in a php variable inside javascript function - El Forum - 08-14-2012 [eluser]Shiju S S[/eluser] I got it with the following jsscript code Code: var count="<?php echo $ctr;?>"; |