我只想用jquery點擊複選框來調用cakephp動作。我只想刷新當前頁面,我希望使用$ .get,因爲我想將其他變量發送到該操作。我嘗試下面的代碼:如何用jquery調用cakephp動作?
HTML代碼:
<?php $chkOpt = array('pertinence' => $pert, 'onClick' => 'refresh_current_page()', 'id' => 'matchCoche'); ?>
<td class="check-column"><?= $form->checkbox($waiting['ArgusWaitingsMobilesPrice']['brand'] . ';' . $waiting['ArgusWaitingsMobilesPrice']['mobile'] . ';' . $waiting['search']['RefAvatar']['mobile_id'], $chkOpt) ?></td>
Javascript代碼:
<script type="text/javascript">
function refresh_current_page() {
$('#matchCoche').ready(function() {
$.get("<?php echo $this->here ?>");
});
}
</script>
有誰可以幫我嗎?
非常感謝您的幫助。