我的iframe:
<iframe name="pictoframeaerial"
src="https://explorer.pictometry.com/login.php""></iframe>
<iframe name="pictoframeoblique"
src="https://explorer.pictometry.com/login.php" "></iframe>
<iframe id="street" class="zoom" name="street"
src="http://localhost/streetview.html" ></iframe>
我的按钮:
$('#print').click(function ()
{
var contentWindow = document.getElementById("street").contentWindow;
var result = contentWindow.document.execCommand('print', false, null);
if(!result) contentWindow.print();
})
谢谢。我已经用window.frames打印方法看到了这一点。请帮忙。
答案 0 :(得分:0)
尝试参考以下代码:
function printPage() {
window.print();
for (var k = 0; k < window.frames.length; k++) {
window.frames[k].focus();
window.frames[k].print();
}
}