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 badges2 Answers
Reset to default 2There 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
评论列表(0条)