Jquery-qrcode generate two-dimensional code

Source: Internet
Author: User

First, Jquery-qrcode

Jquery-qrcode is a jquery plugin that generates two-dimensional code for a browser. It is easy for us to integrate it into our applications. The plug-in can also be used independently, but also relatively small. It is generated directly on the client side to generate the QR code. So there will not be a picture of the download process, to some extent, improve the system performance.

Second, examples

1, Jquery-qrcode is: Https://github.com/dnspod/jquery-qrcode. After the package decompression, there are several files

2. Start Writing Programs

A, create the index.html file, the file content is as follows:

1 <!DOCTYPE HTML>2 <HTML>3 <Head>4 <title>Basic example</title>5 </Head>6 <Body>7 <Scriptsrc= "Jquery-1.10.2.min.js"></Script>8  <Scripttype= "Text/javascript"src= "./src/jquery.qrcode.js"></Script>9 <Scripttype= "Text/javascript"src= "./src/qrcode.js"></Script>Ten <P>Render in table</P> One <DivID= "Qrcodetable"></Div> A <P>Render in Canvas</P> - <DivID= "Qrcodecanvas"></Div> - <Script>  the JQuery ('#qrcodeTable'). QRCode ({ - Render:"Table",                <!--Two-dimensional code generation method - - Text:"http://www.baidu.com"  <!--Two-dimensional code content - -     });  + JQuery ('#qrcodeCanvas'). QRCode ({ - Text:"http://www.baidu.com" +     });  A </Script> at </Body> - </HTML>

Because the plugin is using jquery, we need to introduce jquery support. There are two ways to generate the QR code, one is to use the Web page table to generate the Web page. Another is to use canvas to generate images directly.

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.