用在PHP里的JS打印函数
更新时间:2006年10月09日 00:00:00 作者:
auto=1立即PRINT,否则timeOut毫秒后PRINT,如printPage(0,5000);
function printPage($auto=1,$timeOut=10000) {
if ($auto == 1) {
echo "
< SCRIPT LANGUAGE="JavaScript" >
< !-- Begin
if (window.print) {
window.print();
}
else {
alert('No printer driver in your PC');
}
// End -- >
< /script >
n";
}
else {
echo "
< SCRIPT LANGUAGE="JavaScript" >
< !-- Begin
if (window.print) {
setTimeout('printCheck()','$timeOut');
}
else {
alert('No printer driver in your PC');
}
function printCheck() {
agree = confirm('OK to print now?');
if (agree) window.print();
}
// End -- >
< /script >
n";
}
}
相关文章
php imagecreatetruecolor 创建高清和透明图片代码小结
php imagecreatetruecolor 生成图片示例代码,需要的朋友可以参考下。2010-05-05php环境配置 php5 MySQL5 apache2 phpmyadmin安装与配置图文教程
php环境的配置,对于新手来说,绝对是一件烦事.总会遇到这样那样的问题,走很多弯路.2007-03-03
最新评论