当前位置:系统之家 > 技术开发教程 > 详细页面

用在PHP里的JS打印函数

用在PHP里的JS打印函数

更新时间:2022-05-13 文章作者:未知 信息来源:网络 阅读次数:


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";
}
}

温馨提示:喜欢本站的话,请收藏一下本站!

本类教程下载

系统下载排行