I need to only use a piece of javascript when the print button is clicked, is there a way to do this?
EDIT: A browser print button, i was thinking something like this:
<script type="text/javascript" src="path" media="print"></script>
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is only a partial support from browsers for that. Consider using special CSS stylesheet for print version of the page. For more details look at this question (there are links to several others): execute javascript when printing page