2016年9月份工作知识点汇总

360网站卫士常用前端公共库CDN服务

网址:http://libs.useso.com/

包括:常用前端公共库、google公共库、google字体库。


Jquery知识点1

在拼接html元素的同时,实现事件的绑定。

function createBtn(opType,id,status,ob){
    var str = '';
    if(opType==0){ //首次开通
        if(status==0){ //审核
            str = '<span onclick="firstAuditCard('+id+')" class="ib tc hand audbtn" >审核</span>';
        }else if(status==1||status==2){ //显示
            str = $('<span  class="ofblue hand">详情</span>').click(function(){
                firstCardInfo(ob);
            });
        }
    }else if(opType==1){ //再次修改
        if(status==0){ //审核
            str =  $('<span  class="ib tc hand audbtn" >审核</span>').click(function(){
                modifyAuditCard(ob);
            });
        }else if(status==1||status==2){ //显示
            str =  $('<span class="ofblue hand">详情</span>').click(function(){
                modifyCardInfo(ob);
            });
        }
    }
    return str;
}


CSS知识点1

textarea的输入内容区域尺寸冻结,不可变更

textarea {
  resize : none;
}

Javascript知识点1

javascript传入当前元素对象作为参数,即this的用法:onblur="amountCheck(this);"

function amountCheck(ob){
    var amount = ob.value;
    if(amount==""){
        return true;
    }
    if(/s/.test(amount)){
        $.like.alert_Msg("金额不能包含空格", 0, '');
        return false;
    }
    var reg = /^[1-9]d*|0$/;
    if(reg.test(amount)==false){
        $.like.alert_Msg("金额格式不正确", 0, '');
        return false;
    }
    return true;
}

原文地址:https://www.cnblogs.com/archermeng/p/7537199.html