Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

onbeforeprint handler & link tag - dynamic population

Status
Not open for further replies.

2cxc

Programmer
Aug 29, 2003
245
CA
How would I use the onbeforeprint handler to dynamically populate the link tag to print the correct .txt file(href="printerfriendly.txt") from a called JS function?"
 
I forgot to mention what a link tag is for those who are not sure:

<link rel=&quot;alternate&quot; media=&quot;print&quot; href=&quot;printerfriendly.txt&quot;>

the printerfriendly.txt needs to be populated with
start.txt when the start function is involked, simularily
text1.txt when text1 function is involked;
page2.txt with page2 function; AND
ender.txt with ender function

hope this makes sense!
 
Also....

I'm lost making the association between the JS functions (that are going to be called) to set the href of the link tag?

<head>

<link rel=&quot;alternate&quot; media=&quot;print&quot; href=&quot;printerfriendly.txt&quot;>

<script language=&quot;JavaScript&quot;><!--
function text1(){


}
function text2(){


}
function text3(){


}
// --></script>
</head>

<body onbeforeprint=&quot;text1();text2();text3();&quot;>

Actual page here

</body>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top