how to replace text in the body using javascript
<p>I have the following code to replace all instances of "onAppDeactivate" with "onAppActivate"  in the entire body of the document, but it doesn't seem to be working at all. Any ideas?</p>

<pre><code>var pageSource = document.body.getElementsByTagName("script");

var replaceWithThis = "onAppActivate";
for(var i=0, l=pageSource.length; i&lt;l; i++)
{
    pageSource[i].innerHTML.replace(/onAppDeactivate/gi, replaceWithThis)
}
</code></pre>
