The JavaScript print function window.print() prints the current web page when executed. You can call this function directly using the onclick event as shown in the following example.
Try the following example.
<head><script type="text/javascript">
<!--//-->
</script>
</head>
<body>
<form>
<input type="button" value="Print" onclick="window.print ()" />
</form>
</body>
Although it serves the purpose of getting a printout, it is not a recommended way. A printer friendly page is really just a page with text, no images, graphics, or advertising.
No comments:
Post a Comment
Please write your view and suggestion....