搜索
系统检测到您的用户名不符合规范:

window.onload问题

浏览:1550 发布日期:2015年08月29日 分类:求助交流 关键字: window.onload document.write
function printo(html){
var aaa='<s'+'cript type="text/javascript" src="__PUBLIC__/js/jquery-1.8.2.js"></s'+'cript>';
var nw='<scri'+'pt type="text/javascript">var URL="__URL__";function PrintInit(){print.InitPrint();print.companyName = "科技有限公司";print.seriesNo = "0245-5131-1852-5216";setParameters();}function Preview() {if (document.all.eprint.defaultPrinterName.length==0){alert("请先安装打印机,再执行此功能!");return;}document.all.eprint.InitPrint();document.all.eprint.marginTop=0;document.all.eprint.marginLeft=1;document.all.eprint.marginRight=1;document.all.eprint.marginBottom=0;document.all.eprint.pageWidth=40;document.all.eprint.pageHeight=30;document.all.eprint.header="";document.all.eprint.footer="";document.all.eprint.Preview();}function Print() { if (document.eprint.defaultPrinterName.length==0){alert("请先安装打印机,再执行此功能!");return;}document.eprint.InitPrint();document.all.eprint.header="";document.all.eprint.footer="";document.all.eprint.Print(true);}function setParameters(){document.all.eprint.SetMarginMeasure(1);document.all.eprint.header="";document.all.eprint.footer="";document.all.eprint.pageHeight=30;document.all.eprint.pageWidth=40;document.all.eprint.marginTop = 5;document.all.eprint.marginLeft = 5;document.all.eprint.marginRight = 5;document.all.eprint.marginBottom = 5;}';
var old="window.onload=Print;";
var scr='</s'+'cript>';

var printing='<input type="button" value="打印预览" onclick="Preview()" class="button" style="position:absolute;left:10px;top:10px"><input type="button" value=" 打 印 " onclick="Print()" class="button" style="position:absolute;left:100px;top:10px">';

var newo=window.open('','newwin','height=300,width=400,top=0,left=0,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no');
newo.document.write('<html><head><STYLE MEDIA="PRINT">.button {display:none;}</STYLE><STYLE MEDIA="SCREEN">.button {display:block;}</STYLE>\n');
newo.document.write('<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/print.css"></head>\n');
newo.document.write(aaa);
newo.document.write(nw);
newo.document.write(old);
newo.document.write(scr);

newo.document.write('<body onload="Print();"><object id="eprint" classid="clsid:CA03A5A8-9890-49BE-BA4A-8C524BBBB441" codebase="eprint.cab#Version=3,0,0,6" viewasext> </object>');
newo.document.write(printing);
newo.document.write(html);
newo.document.write('</body></html>');
}
document.write弹出的页,用window.onload执行某函数,却不起作用,请问是什么问题呢,要怎样解决,求助
最佳答案
评论() 相关
后面还有条评论,
评论支持使用[code][/code]标签添加代码
您需要登录后才可以评论 登录 | 立即注册
收藏
季末的温情
积分:7221 等级:LV5
热点推荐
(追記) (追記ここまで)
最新更新

我们

合作

网站

信息

ThinkPHP 是一个免费开源的,快速、简单的面向对象的 轻量级PHP开发框架 ,创立于2006年初,遵循Apache2开源协议发布,是为了敏捷WEB应用开发和简化企业应用开发而诞生的。ThinkPHP从诞生以来一直秉承简洁实用的设计原则,在保持出色的性能和至简的代码的同时,也注重易用性。并且拥有众多的原创功能和特性,在社区团队的积极参与下,在易用性、扩展性和性能方面不断优化和改进,已经成长为国内最领先和最具影响力的WEB应用开发框架,众多的典型案例确保可以稳定用于商业以及门户级的开发。

AltStyle によって変換されたページ (->オリジナル) /