JS网站内容添加干扰符

Js 2020-02-29 22:44:51 评论

seo优化之网站内容添加干扰符

 

JS网站内容添加干扰符

淮安SEO直接上代码,各位同学自己分析

var reBadWords = /|||||||【[a-z]+】|【|】|\[[a-z]+\]|\[|\]|\{[a-z]+\}|\{|\}/gi;
    //var a = document.getElementsByTagName("body")[0];
    var a = document.getElementById('news_con');
    var sUserInput = a.innerHTML;
    var sFinalText = sUserInput.replace(reBadWords,function(sMatch) {
        return sMatch.replace(/./g,"");
    });
    
    a.innerHTML=sFinalText;
function removeElementsByClass(className){
var elements = document.getElementsByClassName(className);
while(elements.length > 0){
elements[0].parentNode.removeChild(elements[0]);
}
}

var a = document.getElementById('news_con');

评论

说点什么吧
  • 全部评论(0
    还没有评论,快来抢沙发吧!