开发者

Printing next Page Javascript

开发者 https://www.devze.com 2023-02-13 04:02 出处:网络
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:no

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消