I normally append an encoded json object to the response body, however I now have a situation that warrants using the ContextSwitch action helper.
I have a Zend_Form
this may help : $this->_helper->json->sendJson($data); while,
$this->_helper->json->sendJson($data);
$data=array('data1'=>'val1','data2'=>'val2');