The moose likes HTML, CSS and JavaScript and the fly likes adding a page link to a js print page Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "adding a page link to a js print page" Watch "adding a page link to a js print page" New topic
Author

adding a page link to a js print page

Penelope Motler
Greenhorn

Joined: Apr 16, 2004
Posts: 1
I am having trouble trying to attach a link to open another page, to a javascript print button. As the page is written on the fly I have added it underneath the function makeWin. i.e.
var text="&It;script language=javascript>function printPage() { print(document); }&It;/script &It;
Then after writing the page I added. &It;input value='Click to Print Page' name=Print type=button on Click=javascript rintPage()&It;";
Before closing with:
customWin = window.open("","customWin","width=790,height=500,left=10,top=5,scrollbars=yes,resizable=no");
customWin.document.open();
customWin.document.write(text);
customWin.document.close();
I can have the page open and the print button works, but I would like to add a link to direct people to another page after pressing print.
I have no idea where to put the link, I have tried everywhere I can think of and get error messages I don't know what I am doing wrong. Your help would save my sanity.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15003
onclick = "window.print();document.location.href='blahUrl'";
onclick = "window.print();window.open('blahUrl')";
but I think that might interfer with the printing of the page, not sure...
 
IntelliJ Java IDE
 
subject: adding a page link to a js print page
 
Threads others viewed
How to display the popup on the button click using Jquery
how to get a variable and print in same page
JSP report
Javascript button is not working after the download.
Javascript
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture