web 页面打印在A页面点击打印按钮 打印出B页面(调用window内置的打印)
2010-06-20 14:29
417 查看
A页面核心代码:
<script type="text/javascript">
function print1(){
document.getElementById('print').src = "<%=request.getContextPath()%>/admin/print.jsp";
}
</script>
<input onclick = "print1()" type = "button" value = "print打印"> <br>
<iframe id="print" name="print" width = "0" height = "0" style = "display:"> </iframe>
B页面核心代码:
<script type="text/javascript">
function doPrint() {
window.focus(); //这个一定要有,否则打印的是A页面+B页面
window.print();
}
</script>
<body onload="javascript:doPrint()">
要打印的内容...
</body>
<script type="text/javascript">
function print1(){
document.getElementById('print').src = "<%=request.getContextPath()%>/admin/print.jsp";
}
</script>
<input onclick = "print1()" type = "button" value = "print打印"> <br>
<iframe id="print" name="print" width = "0" height = "0" style = "display:"> </iframe>
B页面核心代码:
<script type="text/javascript">
function doPrint() {
window.focus(); //这个一定要有,否则打印的是A页面+B页面
window.print();
}
</script>
<body onload="javascript:doPrint()">
要打印的内容...
</body>
相关文章推荐
- 在web服务器上,有些pdf, 怎么让用户在页面上点击一个按钮,就直接打印?
- 点击按钮调用window.print()时不打印按钮(用css控制)
- 转 c# 模拟Asp.net页面中的某个按钮的点击,向web服务器发出请求
- JavaWeb开发,使用jqprint调用打印机打印页面
- window里面点击一个button按钮实现页面跳转???
- WebView点击加载的页面中的按钮时不弹出新窗口以及在加载后执行javascript
- JavaScript调用App原生代码(iOS、Android)通用解决方案 实际场景 场景:现在有一个H5活动页面,上面有一个登陆按钮,要求点击登陆按钮以后,唤出App内部的登录界面,当登录成功
- 使用Web Datawindow ActiveX实现Web页面的打印功能
- 自定义webview中调用app版的地图页面,当我多次点击坐标的时候出现闪退找不到原因,下面是代码求大神指点~~~谢谢~~!!!
- iOS webView 和 H5 页面交互(点击获取H5页面中的按钮,做自己想做的操作)
- Webview页面中按钮实现自动点击
- c# 模拟Asp.net页面中的某个按钮的点击,向web服务器发出请求
- js调用浏览器打印模块实现点击按钮触发自定义函数
- 在webview中浏览页面的时候,实现在点击退出按钮的时候,返回上一页而不是直接退出
- JS调用打印机打印Web页面
- JSF中嵌入JS调用Web页面打印
- android 调用js webView网页,点击提交按钮无效(注意加上setWebChromeClient())
- js调用浏览器打印模块实现点击按钮触发自定义函数
- JavaWeb开发 JS调用打印机打印全部或局部页面
- 调用IE内置打印组件完成web打印方案及例程