Home > php教程 > php手册 > body text

php中调用javascript定时关闭浏览器窗口

WBOY
Release: 2016-06-06 20:10:53
Original
1388 people have browsed it

昨天给大家介绍了《用正则preg_replace把换行br替换为段落p》的方法,今天给大家再分享一点php的小代码,在php中调用javascript定时关闭浏览器窗口: ?php echo 'setTimeout("window.close()",2000);'; ? 如果不想有定时功能,而是直接关闭窗口,那么可以稍

昨天给大家介绍了《用正则preg_replace把换行br替换为段落p》的方法,今天给大家再分享一点php的小代码,在php中调用javascript定时关闭浏览器窗口:

<?php echo 'setTimeout("window.close()",2000);'; ?>
Copy after login

如果不想有定时功能,而是直接关闭窗口,那么可以稍微修改一下上面的代码:

<?php echo 'window.close();'; ?>
Copy after login

记得收藏一下,说不定啥时候都用到哦。。

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template