Javascript - Google QR Code

/* Google QRCode */ function generateGoodQRCodeUrl (data, size, quality, border ) { var api = "https://chart.googleapis.com/chart?cht=qr"; var url = ""; try { url = api; // DATA url += "&chl=" + encodeURIComponent(data);// encodeURI(data); // SIZE if ( size === undefined || size <= 0 ) size = 100; url += "&chs=" + size + "x" + size; // QUALITY if ( quality === undefined ) quality = ""; quality = quality.toUpperCase(); var qual = !( quality=="L" || quality=="M" || quality=="Q" || quality=="H" ) ? "L" : quality; url += "&chld=" + qual; // BORDER url += "|" + (( border === undefined ) ? 0 : border); } catch(err) { return "ERROR"; } return url; } var qrCode = generateGoodQRCodeUrl ( 'http://www.justgooddesign.com', 300 );

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.