1
如何在URL中傳遞studentID?由於它的js變量正在收到錯誤或作爲字符串傳遞。如何在ajax鏈接函數中傳遞js變量
<script>
function updateCallhistory(studentID)
{
<?php
echo CHtml::ajax(array(
'url'=> Yii::app()->createUrl("siteiq/UpdateStudentForm", array("ClassID" => $ClassID)),
'data'=> "js:$(this).serialize()",
'type'=>'post',
'dataType'=>'json',
'success'=>"function(data)
{
if (data.status == 'failure')
{
$('#dialogStudentForm div.divForForm').html(data.div);
// Here is the trick: on submit-> once again this function!
$('#dialogStudentForm div.divForForm form').submit(updateCallhistory);
}
else
{
$('#dialogStudentForm div.divForForm').html(data.div);
setTimeout(\"$('#dialogStudentForm').dialog('close') \",1000);
}
} ",
))?>;
return false;
}
</script>
功能updateCallhistory(studentID)這是一個PHP或js函數? – MJQ
對不起,它的JS功能。我編輯了我的問題 – ASD
這是哪個php變量在這個代碼中? – MJQ