2009年5月12日星期二

[fw-mvc] ZEND MVC and AJAX

Hello,
I am having some issue calling a controller action from ajax. it return
the html for the page and not my data.

controller
class GraphController extends Zend_Controller_Action
{
public function indexAction()
{
}

public function getDataAction()
{
$this->_helper->viewRenderer->setNoRender();
echo "reset to boring";
}
}

myAJAX.js

function initialize()
{
new Ajax.Request('graph/get-data',
{
method: 'get',
onSuccess:populateTotal,
onFailure: function(t)
{
throw new Error('Fetch sizes failed: ' + t.statusText);
}
}
);
}


function populateTotal(t)
{
alert (t.responseText);
}


dir structure
myprog
--APP
----controller
---- view
-----library
---- public
------js
myAJAX.js


------------------------------------

Thanks in advance for any help.

--
View this message in context: http://www.nabble.com/ZEND-MVC-and-AJAX-tp23509588p23509588.html
Sent from the Zend MVC mailing list archive at Nabble.com.

没有评论: