JQuery prints image pdf and txt sample code, and jquery sample code

Source: Internet
Author: User

JQuery prints image pdf and txt sample code, and jquery sample code

Add the following code to html:

<Div style = "display: none "> <div id =" to_print "> </div> <input type =" button "id =" print_button "value =" Print "onclick =" document. getElementById ('filetoprint '). focus (); document. getElementById ('filetoprint '). contentWindow. print (); "/> </div> <script> function printSome (path) {// input file path $ ("# to_print" ).html ('<iframe src =' + path + 'id = "FILEtoPrint"> </iframe> '); setTimeout (function () {$ ("# print_button "). click () ;}, 500) ;}</script>

Add a button on the web interface to call js.


Download the sample code of sharp jQuery (version 2nd)



On the jquerycom website, click jquery to download and display a bunch of jquery code. copy and paste all the code in notepad? I am an idiot.

Do you mean to click these links?

Click these download links to open the source code directly, because some browsers read JS files online, such as firefox and chrome, but some browsers do not support this, such as IE, if you click these links on IE, the following will pop up:

Of course, if you want to directly save the file on firefox or chrome, right-click the link above, select "Save as target" to save the file to the desired location.
I hope my answers will resolve your questions.



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.