<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
<!--
var concernsend = 'leer,,,';
var concernsearch = ',,leer,rose,';
var csearch = concernsearch.split(',');
var csend = concernsend.split(',');
var ok = arr_dive(csearch,csend);
//alert(ok);
if(ok==''){
alert('ok!!');
}else{
alert(ok);
}
function arr_dive(aArr,bArr){ //第一个数组减去第二个数组
if(bArr.length==0){return aArr}
var diff=[];
var str=bArr.join("""");
for(var e in aArr){
if(str.indexOf(aArr[e])==-1){
diff.push(aArr[e]);
}
}
return diff;
}
</script>
</head>
<body>
</body>
</html>
转载于:https://blog.51cto.com/xpmozong/466476