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