My site has a "print this page" button.
I load a static print template HTML file into a hidden iframe, copy the HTML into that page using jQuery, and call window.print()
from the Iframe page. All is well, except on Safari, which wants to print the parent frame as well, so I get two print dialogs opening.
I've tried calling window.print from within the iframe, and calling it from the parent, targetting the iframe (document.printFrame.window.print()
) but I get two dialogs regardless.
Does anyone know a way around this? I only want to print the Iframe, not the parent.