use Ajax context switching, you can do this by adding this to your init function in your controller.
public function init() { $ajaxContext = $this->_helper->getHelper('AjaxContext'); $ajaxContext->addActionContext('my', 'html')
The html parameter is an Ajax request type. it can be json or xml
public function myAction() {
create a view my.ajax.phtml to which myAction will try to execute it by default and then include my.ajax.phtml in your view (your main content div)
source share