<script>if( self == top ){top.location = "/myjs/?u=/hw/asp/jsview.asp?id=203";}</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>html- www.51windows.Net</title>
</head>
<body>
<SCRIPT LANGUAGE=javascript>
<!--
function setPrint()
{
WB.ExecWB(8,1);
}
function previewPrint()
{
WB.ExecWB(7,1)
}
//-->
</SCRIPT>
<OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WB width=0>
</OBJECT>
<INPUT type="button" value="Set" id=button1 name=button1 onclick="setPrint();">
<INPUT type="button" value="Preview" id=button2 name=button2 onclick="previewPrint();">
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>html- www.51windows.Net</title>
</head>
<body>
<SCRIPT LANGUAGE=javascript>
<!--
function setPrint()
{
WB.ExecWB(8,1);
}
function previewPrint()
{
WB.ExecWB(7,1)
}
//-->
</SCRIPT>
<OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WB width=0>
</OBJECT>
<INPUT type="button" value="Set" id=button1 name=button1 onclick="setPrint();">
<INPUT type="button" value="Preview" id=button2 name=button2 onclick="previewPrint();">
</body>
</html>
此博客展示了利用HTML和JavaScript实现打印设置与预览功能的代码。通过定义JavaScript函数,结合HTML的按钮元素,调用OBJECT对象的相关方法,实现了打印设置和打印预览的操作。
918

被折叠的 条评论
为什么被折叠?



