|
|
| |
ƯÁ¤ ¿µ¿ªÀ» ÀÚ¹Ù½ºÅ©¸³Æ®·Î Æ˾÷â ¶ç¿ìÁö ¾Ê°í ÇÁ¸°Æ® Çϱâ |
|
|
|
14³â Àü |
1. ÇÁ¸°Æ® ÇÒ ¿µ¿ªÀÇ Å×ÀÌºí¿¡ id °ªÀ» ÁØ´Ù
ex ) <table id="print_doc"> »ý·«... </table>
2. ÇÁ¸°Æ® ÇÒ°÷¿¡ ÇØ´ç ½ºÅ©¸³Æ® ¿Í iframe¸¦ ÇÏ´Ü¿¡ »ðÀÔÇϸç Ŭ¸¯ ¹öÆ°À» ³Ö¾îÁØ´Ù.
<input type="button" value="ÇÁ¸°Æ®" onclick="print_();"> <!-- ¹öÆ° ³Ö°í½ÍÀº°÷¿¡ ³Ö´Â´Ù.-->
<iframe id="hiddenFrame" name="hiddenFrame" width="0" height="0"></iframe> <!-- Æ˾÷À» ¶Ù¿ìÁö ¾Ê±âÀ§ÇØ-->
<script language="Javascript" type="text/javascript">
<!--
function print_() {
window.open("./print_hidden.php", "hiddenFrame");
window.frames['hiddenFrame'].focus();
}
//-->
</script>
3. °°Àº µð·ºÅ丮 ¾È¿¡ print_hidden.php ¾Æ·¡ ³»¿ëÀ» ³Ö¾î¼ ÆÄÀÏÀ» »ý»óÇÑ´Ù.
<html>
<title>ÇÁ¸°Æ®</title>
<body leftmargin=0 topmargin=0></body>
</html>
<script language="Javascript" type="text/javascript">
<!--
function print_() {
window.print();
}
var base = parent.location.href;
var body = parent.document.getElementById('print_doc').innerHTML;
document.body.innerHTML = "<BASE HREF='"+base+"'>" + body;
window.onload = print_;
//-->
</script> |
|
̵̧ : 246 |
̵̧
¸ñ·Ï
|
|
| |
|