Board Thread:General Coding Help/@comment-26124796-20150221065755

I want to use some JS Scripts to replace/hide some bad words automatically on my Wikia site. Here my code:

$(function {    var str = document.getElementById("WikiaPage").innerHTML;     var res = str.replace(/badword1/gi, "beep").replace(/badword2/gi, "beep");    document.getElementById("WikiaPage").innerHTML = res; });

Then it works. But this code causes break on Wikia Comments Section, Recent Wiki Section in Wikia Rail (those sections don't load) and some issues may I don't know yet.

How can i do now? 