& lt; Div & gt;
& lt; Div & gt;
The $(document). Ready (function () {
Var qrcode=$(" # qrcode "). Qrcode ({
Render: "canvas",//set the render mode, a table and canvas, use canvas rendering performance is relatively good
Text: 'http://jcp.natapp1.cc/gene_detection/authorization.html? OpenId='+ sessionStorage. The getItem (" openId "),//
After scanning the qr code display content, can fill a url directly, after scanning the qr code automatically jump to the link
Width: "200",//the width of the qr code
Height: "200",//the height of the qr code
Background: "# FFFFFF",//scenery of qr code after
Foreground: "# 000000",//the foreground of qr code
SRC: 'http://jcp.natapp1.cc/gene_detection/image/logo.jpg'//qr code in the middle of the picture
}). Hide ();
Var canvas=qrcode. Find (' canvas'). The get (0);
The console. The log (qrcode. Find (' canvas'));
Var data=https://bbs.csdn.net/topics/canvas.toDataURL (' image/JPG);
$(' # img). Attr (' SRC 'data);
CodePudding user response:
CodePudding user response:
The building Lord, this problem solved?CodePudding user response:
Logo is not because of your logo image cross-domain, the images must be found in the source code to generate logo function, add img. SetAttribute (' crossOrigin ', 'anonymous')