var keys = { "和尚":["http://www.baidu.com","#ff0000"], "系统":["http://www.google.com","#00ff00"] } document.body.innerHTML = document.body.innerHTML.replace(/(和尚|系统)/g,function(){ var u=arguments[0]; return u.fontcolor(keys[u][1]).link(keys[u][0]); } );
时间: 2024-10-28 14:38:53