为了让我打印预览“接受”的风格,我需要,包括我的弹出窗口,我使用的打印中的一个函数:如何包括window.open内的jQuery函数
功能我使用的打印是:
$('#printPersonnel').click(function() {
var data = document.getElementById('personnelTable').outerHTML;
var mywindow = window.open('', data);
mywindow.document.write('<html><head><title>NORA Loading</title>');
mywindow.document.write('<link rel="stylesheet" type="text/css" href="http://localhost:49573/Content/Site.css">');
mywindow.document.write('<link rel="stylesheet" type="text/css" href="http://localhost:49573/Scripts/examples-offline.css">');
mywindow.document.write('<link rel="stylesheet" type="text/css" href="http://localhost:49573/Scripts/kendo.rtl.min.css">');
mywindow.document.write('<link rel="stylesheet" type="text/css" href="http://localhost:49573/Scripts/kendo.common.min.css">');
mywindow.document.write('<link rel="stylesheet" type="text/css" href="http://localhost:49573/Scripts/kendo.dataviz.default.min.css">');
mywindow.document.write('<link rel="stylesheet" type="text/css" href="http://localhost:49573/Scripts/kendo.dataviz.min.css">');
mywindow.document.write('<link rel="stylesheet" type="text/css" href="http://localhost:49573/Scripts/kendo.default.min.css">');
mywindow.document.write('</head><body>');
mywindow.document.write(data);
mywindow.document.write('</body></html>');
mywindow.document.close();
mywindow.focus();
mywindow.print();
mywindow.close();
return true;
});
不过,我需要包括以正确添加此格式(我使用Telerik的UI格)一$(document).ready
功能。
这意味着,我需要包括我的文档中的脚本标记。
我的问题在于试图添加结束脚本标签(它把自己看作父页面的一部分,而不是内部的功能)。
任何建议,我怎么能实现这个功能?
我想某个表的标签,这是在文件准备在页面加载看作是一个Telerik的网格格式化内打印一切
编辑
我的问题是与mywindow脚本的结束标记:
mywindow.document.write('});');
mywindow.document.write('</script>'); //issue with this line/seen as esc sequence (i think)
你能提供包括''”);'工作,可能是问题在于里面'.ready'函数体,语法错误还是什么? – Zudwa 2014-12-04 12:57:26