달력

02

« 2012/02 »

  •  
  •  
  •  
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  •  
  •  
  •  
2009/05/06 13:26

div태그로 지정된 영역만 출력 tip/javascript2009/05/06 13:26

미리보기로만 예제를 보실 수 있습니다.
 
1
<html> 
<head> 
    <title>http://www.blueb.co.kr</title> 
     
<script type="text/javascript"> 
  var win=null; 
  function printIt(printThis)  { 
    win = window.open(); 
    self.focus(); 
    win.document.open(); 
    win.document.write('<'+'html'+'><'+'head'+'><'+'style'+'>'); 
    win.document.write('body, td { font-family: Verdana; font-size: 10pt;}'); 
    win.document.write('<'+'/'+'style'+'><'+'/'+'head'+'><'+'body'+'>'); 
    win.document.write(printThis); 
    win.document.write('<'+'/'+'body'+'><'+'/'+'html'+'>'); 
    win.document.close(); 
    win.print(); 
    win.close(); 
  } 
</script> 
</head> 
<body> 

<a href="javascript:printIt(document.getElementById('printme').innerHTML)">Print</a><p> 

<div id="printme"> 
이 부분만 출력</div> 


</body> 
</html>

'tip > javascript' 카테고리의 다른 글

div태그로 지정된 영역만 출력  (0) 2009/05/06
iframe 사이즈 자동조절  (0) 2009/03/11
HTML 간단한 새창 띄우기  (0) 2009/03/03
Posted by 根™