设为首页收藏本站language 语言切换
查看: 1129|回复: 0
收起左侧

在PHP里的JS打印函数

[复制链接]
发表于 2010-2-24 13:34:30 | 显示全部楼层 |阅读模式
<br>                   在PHP里的JS打印函数  <BR><BR>auto=1立即PRINT,否则timeOut毫秒后PRINT,如printPage(0,5000); <BR>function printPage($auto=1,$timeOut=10000) { <BR> if ($auto == 1) { <BR>  echo " <BR>  &lt;SCRIPT LANGUAGE="JavaScript"&gt; <BR>  &lt;!-- Begin <BR>  if (window.print) { <BR>   window.print();  <BR>  } <BR>  else { <BR>   alert('No printer driver in your PC'); <BR>  } <BR>  //  End --&gt; <BR>  &lt;/script&gt; <BR>   "; <BR> } <BR> else { <BR> echo " <BR>  &lt;SCRIPT LANGUAGE="JavaScript"&gt; <BR>  <BR>  &lt;!-- Begin <BR>  if (window.print) { <BR>   setTimeout('printCheck()','$timeOut'); <BR>  } <BR>  else { <BR>   alert('No printer driver in your PC'); <BR>  } <BR>  function printCheck() { <BR>   agree = confirm('OK to print now?'); <BR>   if (agree) window.print();  <BR>  } <BR>  //  End --&gt; <BR>  &lt;/script&gt; <BR>   "; <BR> } <BR>}                   <br><br>
您需要登录后才可以回帖 登录 | 论坛注册

本版积分规则

QQ|Archiver|手机版|小黑屋|sitemap|鸿鹄论坛 ( 京ICP备14027439号 )  

GMT+8, 2025-4-17 03:45 , Processed in 0.082597 second(s), 24 queries , Redis On.  

  Powered by Discuz!

  © 2001-2025 HH010.COM

快速回复 返回顶部 返回列表