Javascript 在Google Chrome中打印iFrame时出现的问题
我有一个iframe像Javascript 在Google Chrome中打印iFrame时出现的问题,javascript,jquery,html,google-chrome,iframe,Javascript,Jquery,Html,Google Chrome,Iframe,我有一个iframe像 <iframe id="Frame1" name="Frame1" style="width: 810px;overflow:hidden;height:525px;border:none;"src="templates/template1.html"> </iframe> 它在Firefox中工作。但不是镀铬的。 在chrome中,将打印template1.html。我想打印template2.html。 当我调用window.print时;它
<iframe id="Frame1" name="Frame1" style="width: 810px;overflow:hidden;height:525px;border:none;"src="templates/template1.html">
</iframe>
它在Firefox中工作。但不是镀铬的。
在chrome中,将打印template1.html。我想打印template2.html。
当我调用window.print时;它将打印整个页面。
请帮助我……您是否可以像我在这里描述的那样使用单独的窗口来打印您的内容
<input type="button" id="btngenerate" onclick="Generate();"/>
<a id="print" onclick="OnPrint();">Print</a>
function generate()
{
var billPath = "templates/template2.html";
$("#Frame1").attr("src", billPath);
}
function onPrint()
{
window.frames["Frame1"].window.focus();
window.frames["Frame1"].window.print();
}