js生成二维码
(1).下载二维码类库
https://github.com/davidshimjs/qrcodejs
(2).引入类库
<script type="text/javascript" src="//static.runoob.com/assets/qrcode/qrcode.min.js"></script>
(3).输出网址二维码到页面
<div id="qrcode"></div>
<script type="text/javascript">
new QRCode(document.getElementById("qrcode"), "https://www.gaojiufeng.cn"); // 设置要生成二维码的链接
</script>(4).其他可选参数:
var qrcode = new QRCode("test", {
text: "https://www.gaojiufeng.cn",
width: 128,
height: 128,
colorDark : "#000000",
colorLight : "#ffffff",
correctLevel : QRCode.CorrectLevel.H
});(5).部分操作方法:
qrcode.clear(); // 清除代码
qrcode.makeCode("http://www.gaojiupan.cn"); // 生成另外一个二维码 window.setInterval(method,time)方法本身会返回一个资源句柄,使用clearInterval(Intervalid)方法即可清除定时器<script> var num=0; //每隔1秒再控制台输...
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> </head> <body>...
开发需求如下,商品下单后需要指定送到日期:送达日期为周一 周三 周六 ,如果今天周一,用户选择周一即为下一周周一。代码如下:<html> <head> <meta charset="utf-8"> <title>...
<!doctype html> <html> <head> <meta charset="utf-8"> <title>无标题文档</title> </head> ...
通过FormData对象可以组装一组用 XMLHttpRequest发送请求的键/值对。它可以更灵活方便的发送表单数据,因为可以独立于表单使用。如果你把表单的编码类型设置为multipart/form-data ,则通过FormData传输的数据格式和表单通过submit() 方法传输的数据格式相同...
基本结构:箭头函数左边是参数,右边是返回值//创建func函数let func = num => num;//上面的func函数等价于let oldFunc = function (num) {...