i have two ajax requests in a page i need only one at a time to execute what should i do…
i have two ajax requests in a page i need only one at a time to execute what should i do…
You can use param from GET request, i.e.
$this->createUrl('action',array('type'=>'list'));
$this->createUrl('action',array('type'=>'show'));
...
and in controller action:
$type=Yii::app()->request->getParam('type');
if($type === 'lsit')
{
do...
}
else
{
do else...
}
If I understand you correctly, then you should execute them synchronously. By default, AJAX calls are asychronous.
The jQuery AJAX options are here: http://docs.jquery.com/Ajax/jQuery.ajax#options (click Options)
Add something like
array('async' => false)
to your CHtml::ajax… helper.
thanks qwerty i used ur idea and got it