This is my prototype code:
new Ajax.Request(BASE_URL + 'hospitals', {
method: 'post',
postBody:'store_id='+store_id+'&isAjax=1',
onSuccess: successFunc,
onFailure: failureFunc
});
This is my controller:
class Mynamespace_Mymodul_Adminhtml_HospitalsController extends Mage_Adminhtml_Controller_Action
{
public function indexAction()
{
var_dump($this->getRequest()->getPost('store_id')); exit();
}
}
The url it set correct. The post parameters are correct and they are sent. But i the response is this:
{"error":true,"message":"Invalid Form Key. Please refresh the page."}
What should I do ?