How to make a simple printerfriendly page from the content of any LDU page and print it out..
Paste the following code between the tags
Then just Edit your LDU page, and place in the following code:
Test it with the link below:
If you want a standard button:
Or if you want an image instead of plain tekst.
Cheers…
Paste the following code between the tags
Code :
// hide source code
// hide line numbers
// hide source code
// hide line numbers
1 <script language="JavaScript" type="text/javascript">
2 var AutoPrint = true; // Indien 'false' wordt de pagina niet automatisch uitgeprint
3
4 function PrintPagina(){
5 if (document.getElementById != null){
6 var html = '<HTML>n<HEAD>n';
7 if (document.getElementsByTagName != null){
8 var headTags = document.getElementsByTagName("head");
9 if (headTags.length > 0)
10 html += headTags[0].innerHTML;}
11 html += 'n</HE' + 'AD>n<BODY>n';
12 var PrintKlaarElem = document.getElementById("PrintKlaar");
13 if (PrintKlaarElem != null){
14 html += PrintKlaarElem.innerHTML;}
15 html += 'n</BO' + 'DY>n</HT' + 'ML>';
16 var printWin = window.open("","PrintPagina");
17 printWin.document.open();
18 printWin.document.write(html);
19 printWin.document.close();
20 if (AutoPrint)printWin.print();}}
21 </script>
Then just Edit your LDU page, and place in the following code:
Code :
// hide source code
// hide line numbers
// hide source code
// hide line numbers
1 <div id="PrintKlaar">
2 Everything that you put between the tags is included in the printpage.
3 </div>
Test it with the link below:
Code :
// hide source code
// hide line numbers
// hide source code
// hide line numbers
1 <a href="javascript:void(PrintPagina())">Print Page</a><br />
If you want a standard button:
Code :
// hide source code
// hide line numbers
`` // hide source code
// hide line numbers
1 <form id="PrintMe" name=" PrintMe ">
2 <input type="button" name=" PrintMe" onClick="PrintPagina()" value="Print Page">
3 </form>
Or if you want an image instead of plain tekst.
Code :
// hide source code
// hide line numbers
// hide source code
// hide line numbers
1 <a href="javascript:void(PrintPagina())">img src="datas/users/yourimage "/></a>
Cheers…
Donation:If you like our free quality work, make a donation by using Paypal and tell us what you would like to see improved on our site for the next few months. |
|
No comments yet













Page Info












