Praise from...

Kelly Lemar
Hi Frank, Thank you so much for all the work you have done. You are extremely flexible, professional, quick, and your work is stellar! It is a pleasure working with you.

Kelly Lemar
Director of IT/Online
Laurel Springs School
Family Center
The Learning Springs

Share EfnWeb, LLC

Facebook MySpace Twitter Digg Delicious Stumbleupon Google Bookmarks 
Javascript dynamic print link PDF Print E-mail
Code Samples

Very simple script to handle a somewhat manual "print-friendly page" setup. Each web page of this site has a parallel print-friendly page not formatted with CSS.

Javascript Dynamic Print Link
(Figure 1)

To avoid hard coding links to the print-friendly pages all over the site, wrote this script to find the current page's file name and append it with a "_p" before the file extension.

For example, if the current page is [index.asp] and its print-friendly page is [index_p.asp] (Figure 2), this script writes the link to the print-friendly page on the fly. On the print-friendly page, the "Print Version" link toggles to become a "Previous Page" link (Figure 3) calling a simple Javascript [history.back()] function taking the user from the print-friendly page back to the CSS-formatted page, allowing for continued browsing through the site.


Javascript Print Link URLs
(Figure 2)

js_print_link_print_prev
(Figure 3)