asked on
ASKER
ASKER
ASKER
ASKER
ASKER
<?php
if ($_GET('print-friendly') == 'true') { ?>
<link rel="stylesheet" type="text/css" media="print" href="print.css">
<?php } else { ?>
<link rel="stylesheet" type="text/css" media="screen" href="screen.css">
<?php } ?>
ASKER
ASKER
ASKER
ASKER
ASKER
ASKER
JavaScript is a dynamic, object-based language commonly used for client-side scripting in web browsers. Recently, server side JavaScript frameworks have also emerged. JavaScript runs on nearly every operating system and in almost every mainstream web browser.
TRUSTED BY
Wow, long time no hear! How have you been?
It sure looks like you are getting really ambitious on your hobby. However, if I understand you right, this sounds to me to be more of a CSS question than a javascript question. You can easily print your page using the javascript window.print() function from any button or link.
You can control what elements from the page you want printed by setting up a separate CSS file for printing. There is a little tutorial on this at http://www.javascriptkit.com/dhtmltutors/cssmedia.shtml