QR code generation library in javascript
jquery-qrcode jQuery plugin also generates QR code using HTML5 canvas element or HTML table, if canvas is not supported.
https://github.com/jeromeetienne/jquery-qrcode
$('#test').qrcode({
width: 120,
height: 120,
text: "https://github.com/jeromeetienne/jquery-qrcode"});
Working jsFiddle demo:
http://jsfiddle.net/maxim75/YwN8p/4/
I wrote a simple GPLv3 qr encoder in javascript that is local, uses HTML5 and is really fast as it is a port of an embedded C version I wrote for Atmel AVR processors.
http://code.google.com/p/jsqrencode/downloads/list
There is a live version (which is saveable as a webapp on iOS devices) at
http://zdez.org/qrenc3.html (save to home, opens in safari so you can copy the image or use airprint)
Here is the link to the downloadable source code.
Script you posted is WORKING, sample.html is not parsed as HTML.