I am trying to get json response from the server. But jquery only g开发者_如何学Goot html. By the way I am using zend framework. Any idea?
Thanks
You could use:
$this->_helper->layout->disableLayout();
or
$this->_helper->viewRenderer->setNoRender();
and then output the JSON.
$this->_helper->json($myArray);
Will disable layout and handle everything including header for you ;)
Just a guess:
You need to use contextSwitch()
action helper, or disable the view and layout rendering and send the JSON response manually.
$json = Array( "name"=>"value" ); header("Content-type: application/json"); echo json_encode($json);
精彩评论