Printing Sections Of A Web Page Using DIVs And JavaScript Remote Scripting
Recently asked on Yahoo! Answers:
Is there an equivalent of “window.print()” in JavaScript for printing individual elements out of a whole page?
For example:Whole page: window.print
Individual Element: document.getElementById(’element’).print…I don’t want to print a whole page, just an individual element.
This really intrigued me because it’s the first time I’ve had cause to use remote scripting with JavaScript. We’re going to use two standard XHTML pages — one, a parent, the other, a helper contained in a hidden iFrame, each with its own JavaScript function.
Let’s get to it, shall we? As always, a link to a working demo appears at the end of the article.
Continue reading ‘Printing Sections Of A Web Page Using DIVs And JavaScript Remote Scripting’ »