ES5中编写函数,为了给参数默认值,必须在函数体内对参数判断,着实揪心。ES6好多了。
<script type="text/javascript">
function run(width = 100, height = 100)
{
console.log(width + '--' + height);
}
run(100);
</script> window.setInterval(method,time)方法本身会返回一个资源句柄,使用clearInterval(Intervalid)方法即可清除定时器<script> var num=0; //每隔1秒再控制台输...
离线缓存的开启实例使用apache设置 1.apache配置文件搜索Addtype,我的addtype已经存在项目,如下 AddType application/x-compress .Z AddType application/x-gz...
<!-- 三个核心方法 openDatabase:这个方法使用现有数据库或创建...
二期项目中生成的简历二维码是使用canvs生成的,微信浏览器中不能识别二维码,只能扫码。懒的换phpqrcode,于是转canvs。//设置一个url var url = "{yun:}$config.sy_weburl{/yun}/mingli/index....
//构造函数 function Box(name,age){ this.name=name; this.age=age; this.run=function(){ return this.name+'--'+this.age; } } var&nbs...
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>点击复制</title> </head>...