如何在 URL 中传递学生 ID?由于它的 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>