数据库更新后,我无法从重定向打开 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>