網頁打印完整代碼

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<style type="text/css" media=print>
.noprint{display : none }
</style>
</head>

<SCRIPT language=javascript>
  function printsetup(){
  // 打印頁面設置
  wb.execwb(8,1);
  } 
  function printpreview(){ 
  // 打印頁面預覽
  wb.execwb(7,1);
  }
  function printit() 
  { 
  if (confirm('確定打印嗎?')) {
  wb.execwb(6,6) 
  } 
  } 
</SCRIPT>

</head>

<BODY>

<DIV align=center>

   <p>

     <OBJECT id=wb height=0 width=0 

classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 name=wb>

     </OBJECT>

     打印內容開始:   </p>

   <p> Many people have asked about the meaning of our name. &quot;Baidu&quot; was inspired by a    poem written more than

800 years ago during the Song Dynasty. The poem compares    the search for a retreating beauty amid chaotic glamour with the

search for    one's dream while confronted by life's many obstacles. &quot;…hundreds and thousands    of times, for her I

searched in chaos, suddenly, I turned by chance, to where    the lights were waning, and there she stood.&quot; Baidu, whose

literal meaning is    hundreds of times, represents persistent search for the ideal.</p>

   <p>打印的內容結束<br />

   </p>

   <p class="noprint"><!--class="noprint"的作用是標示不需要打印的地方-->

<INPUT οnclick=javascript:printit() type=button value=打印 name=button_print /> 

<INPUT οnclick=javascript:printsetup(); type=button value=打印頁面設置 name=button_setup /> 

<INPUT οnclick=javascript:printpreview(); type=button value=打印預覽 name=button_show /> 

</p>

</DIV>

</body>

</html>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章