一些工作上的坑

复杂动态判断:

 ((data[i].warnstatus=="warn"&&data[i].description =="warnSend")?"【手动隔离】":(data[i].warnstatus=="recovery"&&data[i].description =="recoverySend")?"【查看报告】":"") 
 
a标签title遇到空格被截取
 
return "<a style="+'display:block;278px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"'+" id="+'"applyTitle"'+" href="+jumpPage+" target="+'"_blank"'+" title=""+data+"">" + data + "</a>";
 
js中 当需要用变量拼接字符串时,最好指定该变量的数据类型为字符串类型 var str=""; 有时会出现莫名的错误
 
全选与单选
 

$('#searchType input').on('click',function(){
if(this.checked==true){
this.checked==true;
$(this).siblings('[type="checkbox"]').prop('disabled','true');
}else{

this.checked==false;
$(this).siblings('[type="checkbox"]').removeAttr('disabled');
//
}

});

ajax请求数据量比较大时  要指定它的数据类型

 ajax 请求返回的数据量比较大时要指定  dataType类型  json
 定义了  col-md-6之后  不满意其大小占比的话  还可以重新定义  如  col-md-6{50%;}

100*100 图片在不同dpr下显示的规则  为:100/dpr px
 
 
当两组数对比时,特别是他们的长度不固定的时候,比如A有10个数,B有5个数,在B中找与A相等的数
 

var kaiguan;
for(var i=0;i<len;i++){
      kaiguan=false;
     for(var key in rdsName){

        if(rdsName[key].rdsType==$(labCount[i]).attr('regionno')){
              labCount[i].innerHTML= in_title + ' <span style="color:blue;">'+rdsName[key].value+'</span>';
           kaiguan=true;

        }

       if(kaiguan==false){
          labCount[i].innerHTML= in_title + ' <span style="color:red;">0</span>';
       }

    }
}

一定要明白靠自己
原文地址:https://www.cnblogs.com/zjpzjp/p/6439689.html