I am trying to pass a value from php to javascript. I understand one is server side and one is client side. I believe what I am doing should work fine:
PHP Code:
echo "<script type = 'javascript/text'>var x = " . -119 . ";";
echo "var y = " . 49 . ";";
echo "</script>";
Javascript Code:
z = [ x, y ]
But I get the error x and y are undefined.