<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>
<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>
在同一个Domain时<br>
<input onclick='document.frames("mxh").focus();document.frames("mxh").print()' type=button value=print_Iframe><br>
<iframe id=mxh src="d:\hhh.htm"></iframe>
<input onclick='document.frames("mxh").focus();document.frames("mxh").print()' type=button value=print_Iframe><br>
<iframe id=mxh src="d:\hhh.htm"></iframe>
<input onclick='prn()' type=button value=print_Iframe><br>
<iframe id=mxh src="d:\xx.doc"></iframe>
<script>
function prn()
{
var win=window.open("about:blank")
win.moveTo(1200,1200)
win.location=document.all.mxh.src
win.print()
}
</script>
不行吗??
但是doc打不了
<head>
<script language="javascript">
function prn()
{
mxh.focus();
print();
}
</script>
</head><body>
<input onclick="prn()" type="button" value="print_Iframe"><br>
<iframe id=mxh src="http://www.google.com" width="500" height="300" ></iframe>
</body>
</html>