I have a php array of products that I want to move to javascript but when I json_encode it errors out giving me
Uncaught SyntaxError: Unexpected token ;
The debugger is giving me
var phpPro=;
and the code reads
var phpPro=<?php echo json_encode($pro)?>;
I have also encoded the array in the php script and tried to assign to js variable from there.
php =
$jpro=json_encode($pro);
js =
var phpPro=<?php echo $jpro;?>;
This code was actually working and now that I'm trying to copy it to another site it is not working. All the products are in the php recordset when displayed so I know they are there.