JS, 현재 페이지 URL QR코드 생성

4182 단어
span style="color:#800000;">"-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 
 
 
"Content-Type" content="text/html; charset=utf-8"> 
js_canvas_download 
'</span><span style="color:#800000;">text/javascript</span><span style="color:#800000;">'</span> src=<span style="color:#800000;">'</span><span style="color:#800000;">http://cdn.staticfile.org/jquery/2.1.1/jquery.min.js</span><span style="color:#800000;">'</span>> 
"</span><span style="color:#800000;">text/javascript</span><span style="color:#800000;">"</span> src=<span style="color:#800000;">"</span><span style="color:#800000;">http://cdn.staticfile.org/jquery.qrcode/1.0/jquery.qrcode.min.js</span><span style="color:#800000;">"</span>> 

 
 
"qrcode">
"download" download="qrcode.jpg"> <span style="color:#000000;"> jQuery(</span><span style="color:#800000;">'</span><span style="color:#800000;">#qrcode</span><span style="color:#800000;">'</span>).qrcode({ width: <span style="color:#800080;">75</span>, height: <span style="color:#800080;">75</span><span style="color:#000000;">, text: window.location.href }); $(</span><span style="color:#800000;">"</span><span style="color:#800000;">#save</span><span style="color:#800000;">"</span><span style="color:#000000;">).click(function () { </span><span style="color:#0000ff;">var</span> canvas = $(<span style="color:#800000;">'</span><span style="color:#800000;">#qrcode</span><span style="color:#800000;">'</span>).find(<span style="color:#800000;">"</span><span style="color:#800000;">canvas</span><span style="color:#800000;">"</span>).<span style="color:#0000ff;">get</span>(<span style="color:#800080;">0</span><span style="color:#000000;">); </span><span style="color:#0000ff;">var</span> url = canvas.toDataURL(<span style="color:#800000;">'</span><span style="color:#800000;">image/jpeg</span><span style="color:#800000;">'</span><span style="color:#000000;">); $(</span><span style="color:#800000;">"</span><span style="color:#800000;">#download</span><span style="color:#800000;">"</span>).attr(<span style="color:#800000;">'</span><span style="color:#800000;">href</span><span style="color:#800000;">'</span>, url).<span style="color:#0000ff;">get</span>(<span style="color:#800080;">0</span><span style="color:#000000;">).click(); </span><span style="color:#0000ff;">return</span> <span style="color:#0000ff;">false</span><span style="color:#000000;">; }); </span>

 
다음으로 전송:https://www.cnblogs.com/zpblogs/articles/9889884.html

좋은 웹페이지 즐겨찾기