资讯   |   开发   |   选机中心   |   产品大全 | IBM | 惠普 | 联想 | 戴尔 | 苹果 | 神舟
更多: | 华硕 | 明基 | 方正 | 紫光 | TCL | 夏新 | 联宝 | 宏碁 | 七喜 | 长城 | 清华同方 | 海尔 | 三星 | 东芝 | 索尼 | 富士通 | LG | 技术 | ddnoon
当前位置:笔记本 > 软件开发 >
Advertisement
文章正文

关于打印,我不想打印出网页地址和title。

类型:转载   责任编辑:asp.net   日期:2007/05/23


热门软件下载:


   

我直接用  
  <p   onMouseOver="this.style.cursor=hand;"   onMouseDown="print();">打印</p>  
  打出的格式为:  
  title                                                                           页码,1/1  
  内容  
  内容  
  内容  
  内容  
  http://www.XXXXX.com/XXX.asp                                                       2004-9-25  
   
  现在我想成为。  
                                                                                                              页码,1/1  
  内容  
  内容  
  内容  
  内容  
                                                                                                              2004-9-25  
  有没有办法?

网友回答:

发表者:ttyp

在ie的菜单栏里找到“文件”>>“页面设置”,把页眉页脚的文本框里面的内容清空。   或  
   
  <script     language="JavaScript">      
  var   HKEY_Root,HKEY_Path,HKEY_Key;  
  HKEY_Root="HKEY_CURRENT_USER";  
  HKEY_Path="\\Software\\Microsoft\\Internet   Explorer\\PageSetup\\";  
  //设置网页打印的页眉页脚为空  
  function   PageSetup_Null()  
  {  
  try  
  {  
                  var   Wsh=new   ActiveXObject("WScript.Shell");  
  HKEY_Key="header";  
  Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");  
  HKEY_Key="footer";  
  Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");  
  }  
  catch(e){}  
  }  
  //设置网页打印的页眉页脚为默认值  
  function     PageSetup_Default()  
  {      
  try  
  {  
  var   Wsh=new   ActiveXObject("WScript.Shell");  
  HKEY_Key="header";  
  Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"&w&b页码,&p/&P");  
  HKEY_Key="footer";  
  Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"&u&b&d");  
  }  
  catch(e){}  
  }  
  </script>  
  <input   type="button"   value="清空页码"   onclick=PageSetup_Null()>  
  <input   type="button"   value="恢复页码"   onclick=PageSetup_Default()>  
   
  //搜索打印,很多的

发表者:yb2008

1.文件===页面设置,把页眉页脚的文本框里面的内容清空!  
  2.给你个分页打印的例子!  
  <!DOCTYPE   HTML   PUBLIC   "-//W3C//DTD   HTML   4.01   Transitional//EN">  
  <html>  
  <head>  
  <meta   http-equiv="Content-Type"   content="text/html;   charset=gb2312">  
  <title>无标题文档</title>  
  <style>  
  @media   print{  
  INPUT   {display:none}  
  }  
  </style>  
  </head>  
   
  <body>  
   
  <TABLE   border="0"   style="font-size:9pt;"   width="300px"   align="center">  
  <THEAD   style="display:table-header-group;font-weight:bold">  
  <TR><TD   colspan="2"   align="center"   style="font-weight:bold;border:3px   double   red">每页都有的表头</TD></TR>  
  </THEAD>  
  <TBODY   style="text-align:center"">  
  <TR><TD>表格内容</TD><TD>表格内容</TD></TR>  
  <TR><TD>表格内容</TD><TD>表格内容</TD></TR>  
  <TR><TD>表格内容</TD><TD>表格内容</TD></TR>  
  <TR><TD>表格内容</TD><TD>表格内容</TD></TR>  
  <TR><TD>表格内容</TD><TD>表格内容</TD></TR>  
  <TR><TD>表格内容</TD><TD>表格内容</TD></TR>  
  <TR   style="page-break-after:always;"><TD>表格内容</TD><TD>表格内容</TD></TR>  
  <TR><TD>表格内容</TD><TD>表格内容</TD></TR>  
  <TR><TD>表格内容</TD><TD>表格内容</TD></TR>  
  <TR><TD>表格内容</TD><TD>表格内容</TD></TR>  
  <TR><TD>表格内容</TD><TD>表格内容</TD></TR>  
  <TR><TD>表格内容</TD><TD>表格内容</TD></TR>  
  <TR><TD>表格内容</TD><TD>表格内容</TD></TR>  
  <TR   style="page-break-after:always;"><TD>表格内容</TD><TD>表格内容</TD></TR>  
  <TR><TD>表格内容</TD><TD>表格内容</TD></TR>  
  <TR><TD>表格内容</TD><TD>表格内容</TD></TR>  
  <TR><TD>表格内容</TD><TD>表格内容</TD></TR>  
  <TR><TD>表格内容</TD><TD>表格内容</TD></TR>  
  <TR><TD>表格内容</TD><TD>表格内容</TD></TR>  
  <TR><TD>表格内容</TD><TD>表格内容</TD></TR>  
  <TR   style="page-break-after:always;"><TD>表格内容</TD><TD>表格内容</TD></TR>  
  </TBODY>  
  <TFOOT   style="display:table-footer-group;font-weight:bold">  
  <TR>  
  <TD   colspan="2"   align="center"   style="font-weight:bold;border:3px   double   blue">每页都有的表尾</TD>  
  </TR>  
  </TFOOT>  
  </TABLE>  
  <input   type=button   value="   打     印   "   onclick=javascript:window.print()>  
  </body>  
  </html>  
 

发表者:PPLUNCLE

<script   language="VBScript">  
  //去除页眉和页脚  
  function   pagesetup_null()    
          on   error   resume   next    
          Set   RegWsh   =   CreateObject("WScript.Shell")    
          hkey_key="\header"            
          RegWsh.RegWrite   hkey_root+hkey_path+hkey_key,""    
          hkey_key="\footer"    
          RegWsh.RegWrite   hkey_root+hkey_path+hkey_key,""    
  end   function    
  </script>  
  以上是别人的一段代码  
  在onload时加入这段代码就可以了  
   
  <body   bgcolor="#FFFFFF"   class="Normal"   lang=ZH-CN     onload="pagesetup_null()">


 

 
热门推荐笔记本: IBM笔记本
相关文章:
webmaster:popbb@126.com   最佳浏览:1024X768 MSIE
©2007 popbb.net All Rights Reserved