Hello. I am using Zend Framework.
My task is to send JSON
data from controller to Javascript
.
I have an simple array:
$array = array('a' => 1, 'b' => 2);
After i am encoding this array to json format:
$jsonData = Zend_Json::encode($array);
But I don't know, how I can get this data in Javascript
. I send an ajax request with jQuery
. And in success I am trying to alert data.
Note:
If I do die($jsonData);
in the Controller all good.
Thank you in advance!