DORIAN COLLIER
JAN 27
Have you ever needed to print different web page than the one being viewed? This is a requirement for one of our current projects. In searching for an answer I found a lot of forum posts that didn't quite do the trick. I created a lil' Javascript function that'll get the job done. Hopefully somebody, somewhere, finds it useful.
The basic idea is to dynamically create an iframe, load your content, set focus on the iframe, then trigger the browser print function for that iframe.
You can download the code here...
http://deesea.com/keep/PrintUrl.js.zip
Tested in FF3 and IE 7 and 8.
NOTE: The function uses jQuery, but you shouldn't have much trouble un-jQuerying it if you need to.