A two-dimensional code picture appears in the JSP page __js

Source: Internet
Author: User

A recently done project needs to display a two-dimensional code on the foreground page; because I have done two-dimensional code generation before, we used the previous way: Import Qrcode.jar package, and then create the background to save the picture, the foreground to get the picture path, and display. We can see that this process is more time-consuming, a person testing for half an hour, there will be hundreds of two-dimensional code picture, then the background generated temporary two-dimensional code picture when deleted. The first option is my foreground after the display immediately delete, because the system requirements, so the interaction will be very frequent, affect efficiency; the second option is to delete the job at timed intervals. Both of these methods can solve the problem but are a little reluctant.

Can you encapsulate the data into a two-dimensional code at the front desk? Yes, the answer is so sure, because this is so cool. Directly on the point pseudo code look at the glance

<div id= "QRCode" ></div>  //Here div displays the two-dimensional code picture



$ ("#qrcode"). QRCode ({  					       
                text: "In JS support El expression, you know. Write in double quotes between ",
		size:100					      
}";


Text is the content you want to generate a two-dimensional code, size is a dimension; certainly need to import two files, jquery.js and jquery.qrcode.js; Below is the QRCode download address

http://download.csdn.net/detail/lianruanjian/8740913

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.