Friday, February 11, 2011

Biggest Deer Killed In Alabama

Print a page with Javascript


This trick is very simple, if you want your page to be printed with a single click, you can add some code to a button and go.

Example:
Code:

value="Imprimir" /> \u0026lt;input type="button" onclick="window.print()"

The important code here is onclick = "window.print ()" which stated in the event Clicker to print, so you can add to cualguier another label in the same event, or other similar OnClick.

Examples: Print






Code: Link:

\u0026lt;a href="" onclick="window.print()"> Print \u0026lt;/ a>
Image:
\u0026lt;img border="0" onclick="window.print()" src="http://ruta_imagen" />

(you can use an image that's already online if you want to upload one, you can look at server images or icons as Iconfinder.com and copy the URL)

In a Cell \u0026lt;td
onclick="window.print()"> ...\u0026lt;/ td>

And in many other labels more.
I hope you use it, because it is very useful for many types of pages and blog to print content.




0 comments:

Post a Comment