0
我想在ajaxoptions的選項中捕獲javascript/PHP變量。例如;在ajaxoptions中捕獲變量yii
CHtml::ajaxLink("My link", Yii::app()->createUrl('controller/definition'), array(
'data' => array("id" => $model->id),
'type' => 'POST',
'error' => 'js:function(data){}',
'beforeSend' => 'js:function(request){}',
'success' => 'js:function(data){
alert(jQuery(this).attr("id"));
alert({$model->id});
}',
'complete' => 'js:function(data){}',
//'update'=>'#where_to_put_the_response',
), array(
"confirm" => "Are you sure you want to delete?",
"id" => "linkID",
"href" => "javascript:;",
"title" => "mTitle"
)
);
在成功選項,我有兩個警報,告訴你guyz怎麼做我想它。哪些不顯示正確的數據。有沒有什麼辦法讓PHP變量和jQuery(this)對象?