Description:

In this article, I will explain how to print the current page using Jquery. 

We can print the page using window.print() method. This method used to print the contents of the whole page.

It will open print modal dialog box, and user can select the preferred printing options.

All major browsers will support window.print() method.

Example Program:

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript"src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
    </script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('#btnPrint').click(function () {
                window.print();
                return false;
            });
        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div id="PrintContent">
        This is the sample content for Printing
        <asp:Button ID="btnPrint" runat="server" Text="Print" />
    </div>
    </form>
</body>
</html>


Jquery print page, Print a page with javascript, Print a part of the page using Jquery, Printing webpage using Jquery, Simple jquery print page, Printing webpages with jquery, Print section of the page using Jquery, Jquery print method

0 comments:

Post a Comment

 
Top