非常好的打印预览代码


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>2009R11L075810打印预览</title>
<style media=print>
.Noprint{display:none;}
.PageNext{page-break-before:always;}    
</style>  
<style type="text/css">
body{margin:0px; text-align:left; font-size:14px; background-color:#E8E8E8;}
.printDiv{
	text-align:center;
	padding:10px 0px 0px 0px;
	border-bottom:2px solid #999999;
	background-color:#E8E8E8;}
.printBody{
	text-align:center;
	padding:10px 0px 0px 0px;}
</style>
<script language="javascript" charset="gbk" src="/js/prototype-1.5.1.js"></script>
<script language="javascript" defer>
function printCertificate(){
	if (confirm('确定打印吗?')) { 
  		//window.print();
		printIframe.focus();   
  		window.print();
  }
}
function loadingIframeDiv(){
	var ifbody = document.frames("printIframe").document.body;
	if(ifbody){
		//alert(ifbody);
		document.getElementById("printIframe").style.display = 'block';
		document.getElementById("waitDiv").style.display = 'none';
		//ifbody.all.resizeThisIframe();
		//document.frames.printIframe.location.reload();
		document.frames.printIframe.resizeThisIframe();
	}else{
		setTimeout("loadingIframeDiv()", 100);
	}
}

function modifyInfo()
{
	var targeturl = "/cms/getApplyInfo.do?fnum=2009R11L075810&type=R11";
	window.location.href=targeturl;
}

function submitInfo()
{
	var targeturl = "/cms/submitApplyInfo.do?fnum=2009R11L075810&type=R11";
	if(confirm("确认提交后将不能进行再次修改!")){
		window.location.href=targeturl;
		// 刷新父页面
		 if(window.opener)
		 {
	     	window.opener.location.reload();
	     } 
	}
	
}
</script>
</head>

<body οnlοad="loadingIframeDiv();">
<div class="printDiv Noprint">




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

	<INPUT οnclick="javascript:window.close();" type="button" value="关闭窗口" />
</div>
<div id="waitDiv" style="text-align:center; padding:10px 0px 0px 0px;">正在加载,请稍后......</div>
<div id="iframeDiv" class="printBody">
	
	
	
	<iframe id="printIframe" name="printIframe" frameborder="0" scrolling="no"
		src="/cms/getDetailInfo.do?flowNumber=2009R11L075810&type=R11&iframeId=printIframe&flowNumber=2009R11L075810&no=fck"
		style="border:1px solid #336699; display:none;"></iframe>
</div>
</body>
</html>

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值