havey
09-26-2003, 09:17 PM
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="alternate" media="print" href="printerfriendly.txt">
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!
hmm... 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="alternate" media="print" href="printerfriendly.txt">
<script language="JavaScript"><!--
function text1(){
}
function text2(){
}
function text3(){
}
// --></script>
</head>
<body onbeforeprint="text1();text2();text3();">
Actual page here
</body>
I forgot to mention what a link tag is for those who are not sure:
<link rel="alternate" media="print" href="printerfriendly.txt">
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!
hmm... 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="alternate" media="print" href="printerfriendly.txt">
<script language="JavaScript"><!--
function text1(){
}
function text2(){
}
function text3(){
}
// --></script>
</head>
<body onbeforeprint="text1();text2();text3();">
Actual page here
</body>