0

问候!

我是一个努力学习 html 和 javascript 的菜鸟——慢慢来。我正在尝试打印 SimpleModal 提供的 DIV。该页面位于:

www.planetsarsfield.com

此“打印”功能位于底部的配方框中。在 FF 中一切都很好,但在 IE8 中根本不起作用。我必须做一些根本错误的事情,但我无法发现它。

有任何想法吗?

干杯,TY +++++++++++++++++++++++++++++++++++++++++++++++++ +

<script type="text/javascript"> 

function PrintElem(elem) 
{ 
    Popup($(elem).html()); 
} 

function Popup(data)  
{ 
    var mywindow = window.open('', 'basic-modal-content', 'height=400,width=600'); 
    mywindow.document.write('<html><head><title>on the grill... latest recipe</title>');
    mywindow.document.write('<link href="PATH/print.css" rel="stylesheet" type="text/css" />')
    mywindow.document.write('</head><body >'); 
    mywindow.document.write(data); 
    mywindow.document.write('</body></html>'); 
    mywindow.document.close(); 
    mywindow.print(); 
    return true; 
} 

</script>
4

2 回答 2

4

您正在使用的窗口名称使 IE 伤心。请改用“BasicModalContent”。(“window.open”的第二个参数就是我所说的。)

于 2010-04-19T18:09:12.107 回答
1

这是函数定义页面上的链接,其他人报告了“标题中的破折号”问题。看起来Pointy是对的。

http://msdn.microsoft.com/en-us/library/ms536651%28VS.85%29.aspx#6

于 2010-04-19T18:16:20.613 回答