html中怎样实现打印预览ifrom中的内容 求高人指点 谁解决100全给谁

zouzhiqiangzzq 2008-02-28 10:28:30
html中怎样实现打印预览ifrom中的内容
注意::只预览ifrom中的内容
我的代码如下:
table width="100%">
<tr>
<td>
<iframe src="table.html" allowtransparency="true" name="option" id="option" height="610px" width="100%" frameborder="0" scrolling="auto"></iframe>
</td>
</tr>
</table>
</td>
</tr>
</table>
<script language="JavaScript">
function printPreview()
{
document.frames("option").document.wb.ExecWB(7,1);
}
</script>


table.html中
<body oncontextmenu="return false;" topmargin=0 marginheight=0 leftmargin=0 marginwidth=0 style="font-size:12px; overflow-y:auto;background:transparent; ">
<object classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height="0" id="wb" name="wb" width="0"></object>
<table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#BFBFBF">



我预览的是整个页面了
我现在只要预览ifrom 求高人指点


谁解决100全给谁
...全文
447 25 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
25 条回复
切换为时间正序
请发表友善的回复…
发表回复
zouzhiqiangzzq 2008-03-05
  • 打赏
  • 举报
回复
cnchart

以上是我的代码
帮我调试下
谢谢
或者加我的qq370975194帮我下
谢谢
zouzhiqiangzzq 2008-03-05
  • 打赏
  • 举报
回复
<tr class="ListTableRow" id="historyRow8" onClick="javascript:setRowFocus(this,'historyRow')">
<td nowrap>名称设备名称</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<input name="historyRow8Dis" value="设备名称设备名称设备名称设备名称设备名称设备名称设备名称设备名称" type="hidden">
<input name="historyRow8Name" value="historyRow8" type="hidden">
</tr>
<tr class="ListTableRow" id="historyRow9" onClick="javascript:setRowFocus(this,'historyRow')">
<td nowrap>名称设备名称</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<input name="historyRow9Dis" value="设备名称设备名称设备名称设备名称设备名称设备名称设备名称设备名称" type="hidden">
<input name="historyRow9Name" value="historyRow9" type="hidden">
</tr>
<tr class="ListTableRow" id="historyRow10" onClick="javascript:setRowFocus(this,'historyRow')">
<td nowrap>名称设备名称</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<input name="historyRow10Dis" value="设备名称设备名称设备名称设备名称设备名称设备名称设备名称设备名称" type="hidden">
<input name="historyRow10Name" value="historyRow10" type="hidden">
</tr>
<tr class="ListTableRow" id="historyRow11" onClick="javascript:setRowFocus(this,'historyRow')">
<td nowrap>名称设备名称</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<input name="historyRow11Dis" value="设备名称设备名称设备名称设备名称设备名称设备名称设备名称设备名称" type="hidden">
<input name="historyRow11Name" value="historyRow11" type="hidden">
</tr>
<tr class="ListTableRow" id="historyRow12" onClick="javascript:setRowFocus(this,'historyRow')">
<td nowrap>名称设备名称</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<input name="historyRow12Dis" value="设备名称设备名称设备名称设备名称设备名称设备名称设备名称设备名称" type="hidden">
<input name="historyRow12Name" value="historyRow12" type="hidden">
</tr>
<tr class="ListTableRow" id="historyRow13" onClick="javascript:setRowFocus(this,'historyRow')">
<td nowrap>名称设备名称</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<input name="historyRow13Dis" value="设备名称设备名称设备名称设备名称设备名称设备名称设备名称设备名称" type="hidden">
<input name="historyRow13Name" value="historyRow13" type="hidden">
</tr>
<tr class="ListTableRow" id="historyRow14" onClick="javascript:setRowFocus(this,'historyRow')">
<td nowrap>名称设备名称</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<input name="historyRow14Dis" value="设备名称设备名称设备名称设备名称设备名称设备名称设备名称设备名称" type="hidden">
<input name="historyRow14Name" value="historyRow14" type="hidden">
</tr>
<tr class="ListTableRow" id="historyRow15" onClick="javascript:setRowFocus(this,'historyRow')">
<td nowrap>名称设备名称</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<input name="historyRow15Dis" value="设备名称设备名称设备名称设备名称设备名称设备名称设备名称设备名称" type="hidden">
<input name="historyRow15Name" value="historyRow15" type="hidden">
</tr>
<tr class="ListTableRow" id="historyRow16" onClick="javascript:setRowFocus(this,'historyRow')">
<td nowrap>名称设备名称</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<input name="historyRow16Dis" value="设备名称设备名称设备名称设备名称设备名称设备名称设备名称设备名称" type="hidden">
<input name="historyRow16Name" value="historyRow16" type="hidden">
</tr>
<tr class="ListTableRow" id="historyRow17" onClick="javascript:setRowFocus(this,'historyRow')">
<td nowrap>名称设备名称</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<input name="historyRow17Dis" value="设备名称设备名称设备名称设备名称设备名称设备名称设备名称设备名称" type="hidden">
<input name="historyRow17Name" value="historyRow17" type="hidden">
</tr>
<tr class="ListTableRow" id="historyRow18" onClick="javascript:setRowFocus(this,'historyRow')">
<td nowrap>名称设备名称</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<input name="historyRow18Dis" value="设备名称设备名称设备名称设备名称设备名称设备名称设备名称设备名称" type="hidden">
<input name="historyRow18Name" value="historyRow18" type="hidden">
</tr>
</table>
<script Language="javascript">
function a(x,y,color)
{
document.write("<img border='0' style='position: absolute; left: "+x+"; top: "+y+";background-color: #BFBFBF' src='px.gif' width=1 height=2>");
}
function zi(x,y,color)
{
document.write("<span style='FONT-SIZE: 12px; LEFT:"+(x-50)+"; POSITION: absolute; TOP:"+(y-20)+"; color:"+color+"''>横标题</span>");
document.write("<span style='FONT-SIZE: 12px; LEFT:"+(x-150)+"; POSITION: absolute; TOP:"+(y-15)+"; color: "+color+"''>设备名称</span>");
}
</script>
<script>
function line(x1,y1,x2,y2,color)
{
var tmp
if(x1>=x2)
{
tmp=x1;
x1=x2;
x2=tmp;
tmp=y1;
y1=y2;
y2=tmp;
}
for(var i=x1;i<=x2;i++)
{
x = i;
y = (y2 - y1) / (x2 - x1) * (x - x1) + y1;
a(x,y,color);
}
zi(x,y,color);
}
line(td1.offsetLeft,td1.offsetTop,td1.offsetLeft+td1.offsetWidth,td1.offsetTop+td1.offsetHeight,'#000000')
</script>
</BODY>
</HTML>
zouzhiqiangzzq 2008-03-05
  • 打赏
  • 举报
回复
table.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>表格(表头斜线)</TITLE>
<link rel="stylesheet" href="../Common/Main.css" type="text/css">
</HEAD>
<body oncontextmenu="return false;" topmargin=0 marginheight=0 leftmargin=0 marginwidth=0 style="font-size:12px; overflow-y:auto;background:transparent; ">
<object classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height="0" id="wb" name="wb" width="0"></object>
<table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#BFBFBF">
<thead>备名称设备名称设备名称设备名称设备名称</thead>
<tr class="ListTableHeader">
<TD id="td1"> </TD>
<td nowrap >发生时间</td>
<td nowrap >设备IP</td>
<td nowrap >事件类型</td>
<td nowrap >是否处理</td>
</tr>
<tr class="ListTableRow" id="historyRow0" onClick="javascript:setRowFocus(this,'historyRow')">
<td nowrap>名称设备名称</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<input name="historyRow0Dis" value="设备名称设备名称设备名称设备名称设备名称设备名称设备名称设备名称" type="hidden">
<input name="historyRow0Name" value="historyRow0" type="hidden">
</tr>
<tr class="ListTableRow" id="historyRow1" onClick="javascript:setRowFocus(this,'historyRow')">
<td nowrap>名称设备名称</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<input name="historyRow1Dis" value="设备名称设备名称设备名称设备名称设备名称设备名称设备名称设备名称" type="hidden">
<input name="historyRow1Name" value="historyRow1" type="hidden">
</tr>
<tr class="ListTableRow" id="historyRow2" onClick="javascript:setRowFocus(this,'historyRow')">
<td nowrap>名称设备名称</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<input name="historyRow2Dis" value="设备名称设备名称设备名称设备名称设备名称设备名称设备名称设备名称" type="hidden">
<input name="historyRow2Name" value="historyRow2" type="hidden">
</tr>
<tr class="ListTableRow" id="historyRow3" onClick="javascript:setRowFocus(this,'historyRow')">
<td nowrap>名称设备名称</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<input name="historyRow3Dis" value="设备名称设备名称设备名称设备名称设备名称设备名称设备名称设备名称" type="hidden">
<input name="historyRow3Name" value="historyRow3" type="hidden">
</tr>
<tr class="ListTableRow" id="historyRow4" onClick="javascript:setRowFocus(this,'historyRow')">
<td nowrap>名称设备名称</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<input name="historyRow4Dis" value="设备名称设备名称设备名称设备名称设备名称设备名称设备名称设备名称" type="hidden">
<input name="historyRow4Name" value="historyRow4" type="hidden">
</tr>
<tr class="ListTableRow" id="historyRow5" onClick="javascript:setRowFocus(this,'historyRow')">
<td nowrap>名称设备名称</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<input name="historyRow5Dis" value="设备名称设备名称设备名称设备名称设备名称设备名称设备名称设备名称" type="hidden">
<input name="historyRow5Name" value="historyRow5" type="hidden">
</tr>
<tr class="ListTableRow" id="historyRow6" onClick="javascript:setRowFocus(this,'historyRow')">
<td nowrap>名称设备名称</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<input name="historyRow6Dis" value="设备名称设备名称设备名称设备名称设备名称设备名称设备名称设备名称" type="hidden">
<input name="historyRow6Name" value="historyRow6" type="hidden">
</tr>
<tr class="ListTableRow" id="historyRow7" onClick="javascript:setRowFocus(this,'historyRow')">
<td nowrap>名称设备名称</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<td nowrap>&名称设备名称;</td>
<input name="historyRow7Dis" value="设备名称设备名称设备名称设备名称设备名称设备名称设备名称设备名称" type="hidden">
<input name="historyRow7Name" value="historyRow7" type="hidden">
</tr>
zouzhiqiangzzq 2008-03-05
  • 打赏
  • 举报
回复
netQuery.htm


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" href="../Common/Main.css" type="text/css">
<script language="javascript" src="../js/ajax.js"></script>
<script language="javascript" src="../js/calendar.js"></script>
<script type="text/javascript">
function vailData(){
var spans = document.getElementsByTagName("span");
for(var i=0;i<spans.length;i++){
spans[i].style.display="";
}
var basic = document.getElementById("basic");
while(basic.childNodes.length > 0)
basic.removeChild(basic.childNodes[0]);
var fault = document.getElementById("fault");
while(fault.childNodes.length > 0)
fault.removeChild(fault.childNodes[0]);
var modem = document.getElementById("modem");
while(modem.childNodes.length > 0)
modem.removeChild(modem.childNodes[0]);
var cmts = document.getElementById("cmts");
while(cmts.childNodes.length > 0)
cmts.removeChild(cmts.childNodes[0]);
var firewall = document.getElementById("firewall");
while(firewall.childNodes.length > 0)
firewall.removeChild(firewall.childNodes[0]);
var out = document.getElementById("out");
while(out.childNodes.length > 0)
out.removeChild(out.childNodes[0]);
var userName = document.formObject.userName.value;
var cmmac = document.formObject.cmmac.value;
if(userName == null || userName == "")
if(cmmac == null || cmmac == ""){
alert("����������һ�����");
return false;
}
param = 'userName=' + userName + '&cmmac=' + cmmac;
colligateManager(param,'<%=request.getContextPath()%>');
}
var is = 0;
function setRowFocus(objRow,idName){
var rows = document.getElementsByTagName("tr");
var b = 0;
if(objRow.className =='ListTableRowHighlight'){
b = 1;
}
for(var i = 0 ; i < rows.length;i++){
eval("if(rows[i].id.indexOf('"+idName+"')>=0){rows[i].className = 'ListTableRow';}");
}
objRow.className='ListTableRowHighlight';
if(b == 0){
document.getElementById('disText').style.display = "none";
var dis = document.getElementById('dis');
while(dis.childNodes.length > 0)
dis.removeChild(dis.childNodes[0]);
var name = document.getElementById('name');
while(name.childNodes.length > 0)
name.removeChild(name.childNodes[0]);
name.innerHTML=document.getElementsByName(objRow.id+'Name')[0].value;
dis.innerHTML=document.getElementsByName(objRow.id+'Dis')[0].value;
if(is == 0){
setTimeout('empty()',200);
is = 1;
}
is = 0;
}
}
function empty(){
document.getElementById('disText').style.display = "";
}

function flex(object,id){
var divObject = document.getElementById(id);
if(divObject.style.display == ""){
object.src= "../images/tree-plus.gif";
divObject.style.display = "none";
}else{
object.src= "../images/tree-minus.gif";
divObject.style.display = "";
}
}
</script>
</head>
<body oncontextmenu="return false;" topmargin=0 marginheight=0 leftmargin=0 marginwidth=0 style="font-size:12px; overflow-y:auto;background:transparent; ">
<table class="bodybar" width="100%" cellspacing="0" cellpadding="0" border="0">
<tr height="4">
<td></td>
</tr>
<form action="cmmanager.jsp" method="post" name="formObject">
<input type="hidden" name="stat" value="1">
<tr>
<td>
<table border="1" width="100" cellspacing="0" cellpadding="4" bgcolor="#F7F7F7" style="border-collapse: collapse">
<tr>
<td class="menubar">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="10" nowrap>
<table border="0" width="2" cellspacing="0" cellpadding="1">
<tr>
<td><img style="border:1px inset" height=1 width=1></td>
</tr>
<tr>
<td><img style="border:1px inset" height=1 width=1></td>
</tr>
<tr>
<td><img style="border:1px inset" height=1 width=1></td>
</tr>
<tr>
<td><img style="border:1px inset" height=1 width=1></td>
</tr>
</table>
</td>
<td nowrap>
<span class="DetailTagText">�ؼ��� </span>
<input type="text" name="keyword" size="16" style="height:17px; font-size:12px">
  
<span class="DetailTagText">IP�� </span>
<input type="text" name="ip1" size="16" style="height:17px;font-size:12px ">
��
<input type="text" name="ip2" size="16" style="height:17px;font-size:12px ">
  
<span class="DetailTagText">ʱ�� </span>
<input type="text" name="start" size="16" style="height:17px; font-size:12px" readonly="true">
<img onMouseUp="toggleDatePicker('startTime','formObject.start')" height="17" alt="ѡ��ʱ��" src="../images/rili.gif" width="17" align="absMiddle" border="0">
<DIV id="d5" style="POSITION: absolute;top:58px; left:500px; z-index:100;">
<DIV id="startTime"></DIV></DIV>
��
<input type="text" name="end" size="16" style="height:17px; font-size:12px" readonly="true">
<img onMouseUp="toggleDatePicker('endTime','formObject.end')" height="17" alt="ѡ��ʱ��" src="../images/rili.gif" width="17" align="absMiddle" border="0">
<DIV id="d5" style="POSITION: absolute;top:58px; left:670px; z-index:100;">
<DIV id="endTime"></DIV></DIV>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" width="100" cellspacing="0" cellpadding="4" bgcolor="#F7F7F7" style="border-collapse: collapse">
<tr>
<td class="menubar">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="10" nowrap>
<table border="0" width="2" cellspacing="0" cellpadding="1">
<tr>
<td><img style="border:1px inset" height=1 width=1></td>
</tr>
<tr>
<td><img style="border:1px inset" height=1 width=1></td>
</tr>
<tr>
<td><img style="border:1px inset" height=1 width=1></td>
</tr>
<tr>
<td><img style="border:1px inset" height=1 width=1></td>
</tr>
</table>
</td>
<td nowrap>
<span class="DetailTagText">�¼����� </span>
<select name="eventType" size="1" style="height:17px; font-size:12px">
<option value="">��ѡ���¼�</option>
</select>
  
<span class="DetailTagText">�豸���� </span>
<input type="text" name="deviceType" size="16" style="height:17px;font-size:12px ">
  
<span class="DetailTagText">�豸��� </span>
<input type="text" name="deviceName" size="16" style="height:17px;font-size:12px ">
  
<input type="Button" name="ButtonQuery" value="��ѯ" class="ButtonQuery" onClick="javascript:vailData();">
<input type="Button" name="ButtonQuery" value="打印预览" class="ButtonQuery" onClick="javascript:printPreview();">
<input type="Button" name="ButtonQuery" value="打印" class="ButtonQuery" onClick="javascript:vailData();">
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</form>
<tr height="5">
<td></td>
</tr>
</table>
<br>
<table width="100%">
<tr>
<td>
<iframe src="table.html" allowtransparency="true" name="option" id="option" height="610px" width="100%" frameborder="0" scrolling="auto"></iframe>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
<script language="JavaScript">
function printSetup()
{
  wb.execwb(8,1);
}
function printPreview()
{
document.frames("option").document.wb.ExecWB(7,1);
}

function printIt()
{
if(confirm(' 确定要直接打印吗?'))
{
document.frames("option").document.execCommand("Print",false);
  //wb.execwb(6,6);
//parent.option.focus();
//window.print();
}
}
</script>
</html>
zouzhiqiangzzq 2008-03-05
  • 打赏
  • 举报
回复
cnchart
我把我的代码都贴小这
你帮我调试下
谢谢
net.htm

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" href="../Common/Main.css" type="text/css">
<script language="javascript" src="../js/ajax.js"></script>
<script language="javascript" src="../js/calendar.js"></script>
<script type="text/javascript">
function secBoard(n,szURL){
for(i=0;i<secTable.cells.length;i++){
secTable.cells[i].className="sec1";
}
secTable.cells[n].className="sec2";
document.getElementById("option").src=szURL;
}
</script>
</head>
<body oncontextmenu="return false;" topmargin=0 marginheight=0 leftmargin=0 marginwidth=0 style="font-size:12px; overflow-y:auto;background:transparent; ">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="1"></td>
</tr>
</table>
<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%" height="25">
<TR>
<TD class="MainPageHeader" nowrap valign="bottom">
<DIV id="ColumnDisplay" class="ColumnDisplay">网络监控管理</DIV>
</TD>
</TR>
</TABLE>
<table id="secTable" cellSpacing="0" cellPadding="0" border="0" width="30%" height="20px">
<tr align="center">
<td class="sec2" onClick="secBoard(0,'netQuery.htm')">查 询</td>
<td class="sec1" onClick="secBoard(1,'netCount.htm')">统 计</td>
<td class="sec1" onClick="secBoard(2,'netBetimer.htm')">实 时</td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="100%">
<iframe src="netQuery.htm" allowtransparency="true" name="option" id="option" height="610px" width="100%" frameborder="0" scrolling="auto"></iframe>
</td>
</tr>
</table>
</body>
</html>
cnchart 2008-03-04
  • 打赏
  • 举报
回复
[Quote=引用 18 楼 zouzhiqiangzzq 的回复:]
<OBJECT classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height="0" id="WebBrowser" width="0"> </OBJECT>
<input name="Button" onClick="document.all.hiddenframe.ExecWB(7,1);" type="button" value="打印预览">
<iframe frameborder="0" height="10%" width="100%" name="hiddenframe" src="test.htm"> </iframe>


不行
提示错误
[/Quote]

什么错误??我操作系统win2003+IE6,测试正常后发给你的
tenhom 2008-03-04
  • 打赏
  • 举报
回复
用IF句语来判断一下就OK了。。不用想得那么复杂吧
zouzhiqiangzzq 2008-03-04
  • 打赏
  • 举报
回复
<OBJECT classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height="0" id="WebBrowser" width="0"></OBJECT>
<input name="Button" onClick="document.all.hiddenframe.ExecWB(7,1);" type="button" value="打印预览">
<iframe frameborder="0" height="10%" width="100%" name="hiddenframe" src="test.htm"></iframe>



不行
提示错误
zouzhiqiangzzq 2008-03-03
  • 打赏
  • 举报
回复
楼上各位大哥
小第问题依然没有得到解决
谢谢各位大哥关心了
继续帮小弟一把啊
在线等答案哦
zouzhiqiangzzq 2008-03-02
  • 打赏
  • 举报
回复
我只想预览
不过不是另外跳出一个ie来预览
也不能隐藏其他的东西
就是要预览iframe中的内容
望大哥门指教
谢谢
  • 打赏
  • 举报
回复
在点击打印按钮时提交到了一个不带frame的空白窗体中打印预览
想到的办法目前只有这个
  • 打赏
  • 举报
回复
目前没发现更好的方法
  • 打赏
  • 举报
回复
<SCRIPT LANGUAGE=javascript>
function button1_onclick()
{
var odoc=window.right.document;
var r=odoc.body.createTextRange();
var stxt=r.htmlText;
alert(stxt)
var pwin=window.open("","print");
pwin.document.write(stxt);
pwin.print();
}


function button1_onclick2()
{
var oWin=window.open("")
oWin.document.write(top.right.document.body.outerHTML)
oWin.print();
oWin.location.reload();
oWin.close();
}
</SCRIPT>


<input type="button" value="按钮1" onClick="button1_onclick()"/>

<input type="button" value="按钮2" onClick="button1_onclick2()"/>


<iframe frameBorder="0" id="right" name="right2" scrolling="auto" src="panel_index.asp" style="HEIGHT: 96%; VISIBILITY: inherit; WIDTH: 100%; Z-INDEX: 1"></iframe>
  • 打赏
  • 举报
回复
试下9楼方法
  • 打赏
  • 举报
回复
还是打印?
  • 打赏
  • 举报
回复
你只想预览吗?
  • 打赏
  • 举报
回复
给你一个例子

<body>
<input onclick='prn()' type=button value=print_Iframe><br>
<iframe id=mxh src="d:\hhh.htm"></iframe>
<script>
function prn()
{
var win=window.open("about:blank")
win.moveTo(1200,1200)
win.location=document.all.mxh.src
win.print()
}
</script>
zouzhiqiangzzq 2008-02-29
  • 打赏
  • 举报
回复
楼上提的方法我都试过了
问题没有得到解决
请高人继续指点
谢谢了
ycmuma 2008-02-28
  • 打赏
  • 举报
回复
up
  • 打赏
  • 举报
回复
汗!!这个你只要把原来的变下
document.frames("狂架变量名").document.wb.ExecWB(7,1);

这样的形式就可以打印了!
加载更多回复(5)

61,129

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧