Reputation: 1750
I make a jquery ajax request like so:
$.ajax({
type: 'post',
data: '{user : 1234}',
url: '../../mycontroller-ajax/sort',
success: function (response) {
alert(response);
}
}
);
however, in the controller/action part, I disable the view first
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
but if I echo the
$_POST['user']
It says that the index is not defined
Upvotes: 0
Views: 84
Reputation: 587
data : {
'user' : 1234
}
Will definately help but i guess you will also need to include :
dataType : 'json'
Upvotes: 1