advert

Print and Move On - the Code

Ok, so here's the code to do the deed:

Drop this chunk into your <Head> section:

<script type=text/javascript>
var NEW_LOC = "printmoveon.htm";
function goNow() { document.location=NEW_LOC; }
function printPage() {
if (confirm("Ok To Print Page?")) { window.print(); goNow(); }
}
</script>

and then drop this line into your <Body> section - it's the link that actually does the deed, as it were.

<a href="javascript:printPage()">Print This Page</a>

When it's clicked on, the page prints, and the location you have set in the var NEW_LOC statement is the page to which the redirect will take the viewer. In this example, it takes you back to the page you've just read to get here - the description page.

Try it:

Print This Page

 

David Dorn

Keep up to Date with PPC

RSS feed icon

Add to Google

Free Sitemap Generator