<script language="javascript" type="text/javascript"> //<![CDATA[ var allow_keyword = '1'; var url= new Array(); url['转载|http://www.161.com'] = ''; url['淘宝|http://www.162.com'] = ''; url['银行卡|http://www.163.com'] = ''; url['心中有数|http://www.164.com'] = ''; url['从|http://www.165.com'] = ''; var objs = document.getElementsByTagName('div'); var textArea = new Array();
var __index = 0; if (objs && allow_keyword != '0') { for (i = 0; i < objs.length; i++) { if (objs[i].className == 'ReplyContent' ) { textArea[textArea.length] = objs[i]; } } }
function __replaceAll() { if (textArea.length > __index && allow_keyword != '0') { var temp = textArea[__index].innerHTML; for(var keyword in url) { var MyString = keyword.split("|"); var word=""; if(MyString[0]!=null){ word=MyString[0]; } var targeturl="#" if(MyString[1]!=null){ targeturl=MyString[1]; } var filterRegex="([^<=>?&#@'/"])"; var regex = new RegExp(filterRegex+'(' + word + ')'+filterRegex,'i'); var searchText = "$1<a href=/"" + targeturl +"/" target=/"_blank/" class=/"ReplaceKeyword/">$2</a>$3" temp = temp.replace(regex, searchText);