function replaceData(){
var data=[
{oldkey:"pp1",newkey:"宏基"},
{oldkey:"pp2",newkey:"联想"}
];
var stringObj=self.document.body.innerHTML;
for(var i=0;i<data.length;i++)
{
var reg = new RegExp(data[i].oldkey, "g");
stringObj = stringObj.replace(reg,data[i].newkey);
}
//alert(stringObj)
self.document.body.innerHTML=stringObj;
}
replaceData()
posted on 2011-10-28 23:57
王豪 阅读(468)
评论(0) 编辑 收藏 所属分类:
JQuery