javascript 判斷有無敏感詞
var keywords=["中華人民共和國","台灣獨立","中共","共匪"]; //遍历敏感词数组 for(var i=0;i<keywords.length;i++){ //判断内容中是否包括敏感词 if(experience.indexOf(keywords[i])!=-1){ console.log('有髒話'); isPass = false; } } https://blog.csdn.net/youyou_yo/article/details/51878439