页面导航: 首页网络编程PHP编程php教程 → 正文内容

用在PHP里的JS打印函数

发布:dxy 字体:[增加 减小] 类型:转载

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里的JS打印函数相关内容

文章评论

共有 位脚本之家网友发表了评论我来说两句

同 类 文 章
最 近 更 新
热 点 排 行