I would like to know if it's possible to do something like that:
x$().xhr('<?php echo $this->createUrl('survey/index', array('id'=>$model->skey)); ?>', {
method: 'POST',
async: true,
data: urlstringserialize(serialize(document.getElementById("token-form"))),
callback: function() {respOK(this.responseText);}
});
x$().xhr('<?php echo $this->createUrl('survey/saveBrowser', array('id'=>$model->skey,'browser'=>$browser->getBrowser(),'platform'=>$browser->getPlatform())); ?>', {
method: 'POST',
async: true,
data: urlstringserialize(serialize(document.getElementById("token-form"))),
callback: function() {respOK(this.responseText);}
});
I need to call two different controller functions, one after the other. In this way only the first one is executed.
If you want to Execute the second request after the first one, you just need to make the request inside the Callback.
The Problem of the only the first one get called can depend on the Library you are using that seems to be "x$".