Is there a 开发者_如何学运维way to print the page that gets openned using target="_blank"
with javascript (or jquery) instead of printing the current one?
maybe you can use an iframe (with display:none css style) to load the url content and then print the iframe
bye!
No. A window opened using target="_blank"
has no programmatic connection to the page it was opened from.
If it was opened with window.open
then the return value of that call would be a reference to that window, so you could use that to get to the print
method (subject to the same origin policy).
That said, I can't think of any reason to do this that would not be better served by a print media style sheet.
精彩评论