BlogCFC Print Using DOM Injection

For some reason I clicked the print button on my blog the other day. It opened up a PDF in the tab I was in. Well, I just didn't like that (sorry Ray).

I recently built a print feature for an AJAX heavy project at work. Since this project uses Spry, the detail you see doesn't exist until javascript renders it in the browser. So, I came up with a solution of opening another window and then pushing the rendered contents into it. The new window even has a print.css. So, although it's the same mark-up, it looks different.

If you want to see the code I wrote for work you can check it out here. Just drill all the way into a vehicle and click the print button on the right.

Anyway, I used the same idea to change the print functionality on my blog. I've posted the resulting code and instructions for download here.

If anyone uses it I would love to hear about it.

Comments
todd sharp's Gravatar I don't really like that when I click cancel in the print window the browser window (tab) closes. You really should let the user decide when they're done with the window/tab.

Other then that it looks cool. Not sure why you had to use AJAX/Spry for this though?
# Posted By todd sharp | 4/17/07 6:34 AM
Chris Phillips's Gravatar todd,

I'll get rid of the window closing when I get a chance. That was an example of me getting a little too clever :-).

And I didn't use Spry or AJAX for the print implementation on BlogCFC. I was saying that I came up with this concept while working on a Spry/AJAX heavy project at work. Which means nothing is rendered until Spry renders it...
# Posted By Chris Phillips | 4/17/07 3:30 PM
BlogCFC was created by Raymond Camden. This blog is running version 5.6.002.