我無法在數據庫更新後從重定向打開jQuery窗口。當頁面重定向時,我已經編碼,以便可以根據該值獲取值並打開窗口。下面的例子。從php重定向錯誤打開jquery對話框
header("Location: http://localhost/sample/users/cp.php?dialog=1");
exit();
在cp.php中我有下面的代碼,它不觸發窗口。但是,如果我更改了autoOpen:true,則會在加載頁面時加載該窗口。如果有人能指出我的錯誤,我將不勝感激。由於
cp.php
<?php
$dialog = $_GET['dialog'];
if ($dialog ==1)
{
echo '<script type="text/javascript"> dialog(); </script>';
}
?>
<script src="js/jquery-1.3.2.min.js"></script>
<script src="js/ui.dialog.js" type="text/javascript"></script>
<link href="css/redmond/jquery-ui-1.7.3.custom.css" rel="stylesheet" type="text/css" media="all" />
<script type="text/javascript">
function dialog() {
$(function() {
$("#response1").dialog({
modal: true,
autoOpen: false,
buttons: {
Ok: function() {
$(this).dialog("close");
}
}
});
});
}
</script>
<div style="display:none" id="response1" title="Successfully updated destroy date">
<p>
<span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
You have successfully updated your destroy date. You may now close this window. Thank you.
</p>
</div>
您呼應調用腳本'對話框()'該聲明功能 – Bergi