04 2020 档案
摘要:``` private function left_time_str($sale_time){ saletime=strtotime(sale_time); lefttime=sale_time - time(); if(lefttime0)str .= day.′天′;if(hour >...
阅读全文
摘要:``` var tmp_arr_1 = new Array(); var tmp1 = {'type':1,'plan_num':200}; tmp_arr_1.push(tmp1); tmp_arr_1.push(tmp1); console.log(tmp_arr_1); tmp_arr_1[0]['type'] = ' '; console.log('--变化一个后--'); console
阅读全文
摘要:``` js中字符串的替换在js中字符串全部替换可以用以下方法:两种区别:正则&常规str.replace("需要替换的字符串","新字符串") str.replace(/需要替换的字符串/g,"新字符串")比如:"yyyy-MM-dd-hh-mm-ss".replace("-","/")结果如下: "yyyy/MM-dd-hh-mm-ss""yyyy-MM-dd-hh-mm-ss".replac...
阅读全文
摘要:new Promise(function(resolve){ console.log('马上执行for循环'); for(var i = 0; i < 1000; i++){ resolve(); console.log(i); } }).then(function(){ console.log('
阅读全文
摘要:``` 文字 使用第一种的方法e.target.dataset.action 会获取当前点击的元素的action,则获取图片上的action,图片上没有action便取的是undefined; 使用第二种的方法e.currentTarget.dataset.action 会获取有事件的那个元素,即view,所以获得“father” ```
阅读全文