Print Page and then Re-Direct

[Total: 0    Average: 0/5]

This shows how to print a page and then redirect the user.

Head Code:

<script type=text/javascript> 
var NEW_LOC = ""; 
function goNow() { document.location=NEW_LOC; } 
function printPage() { 
  if (confirm("Ok To Print Page?")) {
  // The redirection occurs even if the page is not printed.
  // If you want to do the redirection only if the page is
  // printed, insert the following statement into the above
  // if block denoted by { and }

Body Code:

The call to printPage could have been inside the body tag or
inside a javascript section: printPage();
<a href="javascript:printPage()">Print This Page</a>

Times Viewed: 13

Leave a Reply

Your email address will not be published. Required fields are marked *