Usage
First you need to include the jQuery library, since ClassyQR is a plugin. You can download it from the jQuery website or link it directly from the Google CDN.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
Secondly, you need to include the jQuery ClassyQR javascript file into your page. You can do it by adding the code below to your page.
<script src="js/jquery.classyqr.js"></script>
Now, you have two possibilities of embedding a QR code.
1. Create the image tag that will be replaced with the QR code image.
<img src="#" id="qr1" alt="" />
For the last part you activate the ClassyQR() function on the element you just created, so, we trigger the function on the image with the id qr1.
$("#qr1").ClassyQR({ type: 'text', text: 'This is the text to embed' });
2. Add a div with a specific id to your page, for example :
<div id="qr2"></div>
We trigger the function on the div with the id qr2 AND we add the create: true option, which signals the library to create the image tag inside the container div.
$("#qr2").ClassyQR({ create: true, type: 'text', text: 'This is the text to embed' });