• USA : +1 973 910 5725
  • INDIA: +91 905 291 3388
  • info@tekslate.com
  • Login

Page Printing in JavaScrpit

JavaScrpit Page Printing

Many time you would like to give  a button at your webpage to  print out the content of that webpage via and actual printer.

Javascript helps you to implement this functionality using print function of window object.

The javascript  print function window.print() will print the current webpage when execute .You can call this function directly using onclick event as follows:

<head>

<script type=”text/javascript”>

<!- –

//–  >

</script>

</head>

<body>

<form>

<input type=”button value=”print “ onclick =”window.print():/>

</form>

</body>

How to print a page:

If someone is providing none of the above facilities then you can use browsers standard tool bar to get tht webpages printed out.Follow the link as follows:

File   2 print   2 Click OK button.

JavaScript-Page Redirection

When you click a URL to reach to apage X but internally you are directed to another page Y that simply happens because of page re-direction.

<head>

<script type=”text/javascrpit”>

function fun1(){

window location =http://www.newlocation.com;

}

</script>

</head>

Summary
Review Date
Reviewed Item
Page Printing in JavaScrpit
Author Rating
5

“At TekSlate, we are trying to create high quality tutorials and articles, if you think any information is incorrect or want to add anything to the article, please feel free to get in touch with us at info@tekslate.com, we will update the article in 24 hours.”

0 Responses on Page Printing in JavaScrpit"

    Leave a Message

    Your email address will not be published. Required fields are marked *

    Site Disclaimer, Copyright © 2016 - All Rights Reserved.

    Support


    Please leave a message and we'll get back to you soon.

    I agree to be contacted via e-mail.