Nonsense not much said, directly affixed to the code, the specific contents are as follows;
<div id = "Qrcodeid" ></div>//generated two-dimensional stacking in this div <script type= "text/javascript" src= "js/" Jquery.qrcode.min.js "></script>//introduced qrcode.js (to Https://github.com/jeromeetienne/jquery-qrcode download) <
script> function Utf16to8 (str) {//Resolve Chinese garbled var out, I, Len, C;
out = "";
len = str.length;
for (i = 0; i < len; i++) {c = str.charcodeat (i);
if ((c >= 0x0001) && (c <= 0x007f)) {out = = Str.charat (i); else if (C > 0x07ff) {out + = String.fromCharCode (0xe0 |
((c >>) & 0x0f)); Out + + string.fromcharcode (0x80 |
((c >> 6) & 0x3F)); Out + + string.fromcharcode (0x80 |
((c >> 0) & 0x3F)); else {out = = String.fromCharCode (0xc0 |
((c >> 6) & 0x1F)); Out + + string.fromcharcode (0x80 |
((c >> 0) & 0x3F));
} return out; } </script> <script>//here to generate a business card two-dimensional code (if you want to generate a normal link two-dimensional code then the "text" parameter value directly replace the normal link) var the_text = "Begin:vcard \r\nfn: Name \ r \ntel; CELl,voice:15000000000 \r\ntitle: Title \r\norg: Company (organization) \r\nemail;internet,home:123@qq.com \r\nadr;
Work,postal: Earth China Shandong ... \r\nurl:http://leerd.cn \r\nend:vcard ";
The_text = Utf16to8 (The_text);
alert (The_text); JQuery (' #qrcodeid '). QRCode ({width:140, height:140, Render: "Canvas",//Set render mode table Canvas Typenumber:-1,//Calculation mode Corre
ctlevel:0,//error correction level background: "#ffffff",//Background color foreground: "#000000",//Foreground color text:the_text}); </script>
The above content is the entire content of this article, I hope you like.