【发布时间】:2011-05-10 16:50:51
【问题描述】:
为什么这在 INTERNET EXPLORER 上不起作用:
我有这个 html 输入标签。我调用我的 js 函数在 toprint 元素上做一些工作。在 FF 中,chrome 可以正常工作。但是在 IE 上我得到“缺少参数错误”。
<input type="button" onclick="PrintElem('#ToPrint')" value="<?php echo t("DOWNLOAD");?>" />
div 元素位于页面中的某处,例如:
<div class="letterBody paddingLg LmarginXlg" id="ToPrint">
<p>bla bla</p>
</div>
<script type="text/javascript" language="javascript">
function PrintElem(elem)
{
Popup($(elem).html());
}
function Popup(data)
{
var mywindow = window.open('', 'Press Release');
mywindow.document.write('<html><head><title><?php echo $data->title ;?></title>');
mywindow.document.write(' <link rel="stylesheet" type="text/css" media="all" href="<?php echo base_path().$directory; ?>/css/printA4.css"/>');
mywindow.document.write('</head><body onload="" class="printA4">');
mywindow.document.write(data);
/*
$(document).ready(function() {
this.title = '<?php echo $data->title ;?>'
var salonLogo = $("#salonLogo").attr("src")
var imgSalonLogo = salonLogo.search("salonlogo")
if(imgSalonLogo == -1){
$("#salonLogo").attr("src","")
}
})
*/
mywindow.document.write('</body></html>');
mywindow.document.close();
mywindow.print();
return true;
}
$(document).ready(function() {
this.title = '<?php echo $data->title ;?>'
})
</script>
【问题讨论】:
-
请描述您的错误。 IE版??错误在哪一行没有。??格式正确
-
但是 ie 会发生什么?没有弹窗?弹出的值错误?