程序员写代码的细节问题

2018-12-10  本文已影响0人  静_c540

1.写了定时器离开页面要关闭定时器

var pl=setTimeout(function () {

}, 10000);

clearTimeout(pl);

2.文本输入框的必去特殊字符

var b ='';

if(that.ruleForm.title!=''){

for (let i =0; i < that.ruleForm.title.length; i++) {

b += that.ruleForm.title[i].replace(/\s/g, '')

}

}

that.ruleForm.title = b;

that.ruleForm.title =encodeURIComponent(that.ruleForm.title);

上一篇下一篇

猜你喜欢

热点阅读