日期:2014-05-16  浏览次数:20325 次

JS之文本的查找跟替换

<script type="text/javascript">
<!--
window.onload = function()
{
?try
?{
??var doc = parent.document;
??var Frm = doc.getElementById( "content" );
??var Obj = doc.body || doc.documentElement;
??if(typeof Frm != "object" || Frm == null)
??{
???Obj.innerHTML = Obj.innerHTML.replace(/2009年下半年/g, "2011年上半年" );
???var Frms = document.getElementsByTagName( "iframe" );
???for( var i in Frms )
???{
????if(Frms[i].src == "header.html")
????{
?????Frms[i].id = "content";break;
????}
???}
??}
?}
?catch(E){}
}
-->
</script>