jquery - isAjaxRequest always return false -


i got error message

404,'model has not been saved' following code

my action controller

public function actionextend($id) {         $model=$this->loadmodel($id);         if(yii::app()->request->isajaxrequest) {             $model->todate = date('y-m-d h:i:s a',(strtotime('next month',strtotime(date('y-01-d')))));             if($model->save()) {                 yii::app()->end();             }             else {                 throw new chttpexception(404,'model has not been saved');          }     } } 

the jquery call

 $("#buttonextend<?php echo $this->post_row;?>").click(function(e){             $.ajax({                type: "post",                url: "<?php echo yii::app()->createurl('post/extend', array('id' => $data['id'])); ?>",             });  }); 

why not ajax call ?

thank help

i found response, missed } , function go else part of if


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -