I have this JS inside my php code:
echo " for (var i = 0; i<length; i++){
alert('array[i]');
}";
Assuming all variables were defined and initialized, i'm not getting any output from the alert.
However, if i replace array[i] with array[2], I get that value alerted.
any advice?