美文网首页
程序员写代码的细节问题

程序员写代码的细节问题

作者: 静_c540 | 来源:发表于2018-12-10 15:25 被阅读0次

    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);

    相关文章

      网友评论

          本文标题:程序员写代码的细节问题

          本文链接:https://www.haomeiwen.com/subject/ctufkftx.html