| Javascript dynamic print link |
|
|
|
![]() (Figure 1)
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. 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. ![]() (Figure 2)
(Figure 3)
|





