推荐专题
最新下载
热门教程
- 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";
}
}
相关文章
- 《鸣潮》七连跳攻略 04-19
- 塞尔达传说王国之泪无限复制料理方法介绍 04-19
- 女神异闻录夜幕魅影mona武器该怎么选择 04-19
- 射雕手游以万贯易一饼成就怎么达成 04-19
- 星露谷物语1.6特殊物品与能力获取方法 04-19
- 保卫萝卜4周赛4.19怎么过 04-19