javascript print link - Stack Overflow

as I am new to Javascript you guys might save me some time answering this simple question.How to make J

as I am new to Javascript you guys might save me some time answering this simple question.

How to make Javascript functionality that prints linked document(not the current window).

Lets say that www.example/print/index.html contains button that I want to print www.example/print/example.html content.

Solution I have found so far opens 2 new windows(content itself & print preview) and that hurts me, as I want print preview only

window.open('www.example/print/example.html').print();

Thank you

as I am new to Javascript you guys might save me some time answering this simple question.

How to make Javascript functionality that prints linked document(not the current window).

Lets say that www.example./print/index.html contains button that I want to print www.example./print/example.html content.

Solution I have found so far opens 2 new windows(content itself & print preview) and that hurts me, as I want print preview only

window.open('www.example./print/example.html').print();

Thank you

Share Improve this question asked Nov 10, 2011 at 13:31 daniel.tosabadaniel.tosaba 2,5639 gold badges36 silver badges47 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 2

There is no solution that you can print page2 by putting print button on page1 here are some solution that might help you to achieve your task easily : How to print a web page without opening a popup window?

If you are open to jquery here is a plugin that does what you need:
http://www.position-absolute./articles/printing-web-pages-a-new-jquery-printing-plugin/

You can always do the same in javascript as well, the idea is to get the content of page2.html in an hidden iframe on page1.html from where you want to trigger the print, here is a discussion on the same, look at the solution from Trace.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745429046a4627310.html

相关推荐

  • javascript print link - Stack Overflow

    as I am new to Javascript you guys might save me some time answering this simple question.How to make J

    6小时前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信