最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
用在PHP里的JS打印函数
时间:2022-07-02 10:07:47 编辑:袖梨 来源:一聚教程网
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";
}
}
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";
}
}
相关文章
- CF手游boss卡上限重置时间攻略 04-25
- 蛋仔派对爆爆狐技能最强搭配指南 04-25
- 深空之眼震离月读搭配方案推荐 04-25
- 以闪亮之名玩呐第13章如何快速通关 04-25
- 决胜巅峰大铁罐最强怎样出装最合适 04-25
- 以闪亮之名食谱领悟流程哪几种 04-25