javascript - Open a link in new window and then show print window instantly -
i want show url content in new popup window , after instantly show print window print content of url, may ask how can this?
i edit question: want open popup window, load specific div of given url (for print friendly view of post) , after load finished, open print window...
have idea it?
my solution quite simple on current link have inline onclick event definition like: onclick="window.open(....)", add ".print()" after ".open()" in order automatically show printing dialog after loading url, have tested on chrome , firefox linux , works expected.
my code looks this:
<a class="btn btn-success" href="#" onclick="window.open('url_to_post','popup window title here','width=650,height=800').print()">print</a> hope looking for
Comments
Post a Comment