JavaScript Reference/Event Handlers Reference/onBeforePrint

Материал из Web эксперт
Версия от 11:22, 26 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

"onBeforePrint" Example

   <source lang="javascript">
   

<head> <script language="JavaScript">

  function function1() {
      window.print(); 
   } 

</script> </head> <body onbeforeprint="alert("This page is about to be printed")">

Some body Content to print.

   <input type="button" value="Print" onclick="function1()">

</body> </html>


     </source>
   
  


"onBeforePrint" is applied to

   <source lang="javascript">

+----------------+--------------------------------------------------------------+ | Applied_To |<body> <frameset> | | |window | +----------------+--------------------------------------------------------------+

     </source>
   
  


"onBeforePrint" Properties

   <source lang="javascript">

+----------------+--------------------------------------------------------------+ | Properties |altKey altLeft | | |button cancelBubble | | |clientX clientY | | |ctrlKey ctrlLeft | | |returnValue screenX | | |screenY shiftKey | | |shiftLeft srcElement | | |type x | | |y | +----------------+--------------------------------------------------------------+

     </source>
   
  


"onBeforePrint" Syntax and Note

   <source lang="javascript">

Note:

This event fires before the document prints.


     </source>