This is a fairly standalone script for producing QR code on the fly. Originally developed for my own interest, the code is fully commented and well-structured. The code is in the public domain (or to be exact, Creative Commons Zero), and you can use it for absolutely any purpose.
See also a node.js module based on qr.js, packaged by Nadav Ivgi.