3

好的,所以我有一个页面会将信息发布到数据库,然后它会返回到另一个页面。现在唯一的事情是他们希望页面在警报出现后自动关闭,告诉他们数据库内容已保存。我将它放在条件 if 语句下的 php 页面上,然后从那里运行 javascript。唯一不工作的事情。我已经尝试过 window.close 和 self.close 并且只是 close() 但似乎没有任何想法。也在 Chrome 中尝试这个。

if( $_POST['finished'] == 'Send' )  
{

(this is just DB stuff here)

echo "<script type='text/javascript'>ConfirmStatus = confirm('Thank you for entering the information.')

if (ConfirmStatus == true) {

self.close();
}</script>";    
}
4

1 回答 1

0
echo "<script type='text/javascript'>
    if (confirm('Thank you for entering the information.')){
    window.close();
    }</script>";
于 2012-04-11T16:32:16.693 回答