Jquery.qrcode.js is a jquery plug-in that generates a two-dimensional code. The volume is less than 4 K after compression. It is convenient to use it to generate a two-dimensional code for the current page.
Example:
<! DOCTYPE html>
<title>jquery to generate the current page's two-dimensional code </title>
<meta charset= ' Utf-8 '/>
<!--JS Reference package-->
<script Src=/dl/jquery/js/jquery-1.8.3.min.js ' ></script>
<script type= "Text/javascript" src= "/dl/jquery/js/jquery.qrcode.min.js" ></script>
<style>
#qrcodeCanvas {
Position:absolute;
height:200px;
width:200px;
margin:-100px 0px 0px-100px;
top:50%;
left:50%;
}
</style>
<body>
<!--two-dimensional code rendering area-->
<div id= "Qrcodecanvas" ></div>
</body>
<script style= ' Text/javascript ' >
$ (' #qrcodeCanvas '). QRCode ({
text:window.location.href,//the string represented by the two-dimensional code (URL of this page)
width:200,//two dimensional code width
height:200//two dimensional code height
});
</script>
The effect is as follows
Note: Plug-in download can be directly to the jquery official download or Baidu search jquery two-dimensional code plug-in can download