title: Greasemonkey renaming texts from array only works once
body: <p>just discovered greasemonkey and played a bit.
  I tested this line to change text content of a website</p>
  
  <pre><code>document.body.innerHTML= document.body.innerHTML.replace("someone","funny");
  </code></pre>
  
  <p>and it worked just fine.
  I wanted to replace some more texts on that website but did not want to copy &amp; paste that again and again so I wrote a little function like:</p>
  
  <pre><code>function a(s,d){document.body.innerHTML= document.body.innerHTML.replace(s,d);}
  </code></pre>
  
  <p>calling it that way:</p>
  
  <pre><code>a("test","success");
  </code></pre>
  
  <p>Also without problems. But then I wanted to call that function multiple times; like:</p>
  
  <pre><code>a("test","success");
  a("some","thing");
  </code></pre>
  
  <p>but my script only executed the first function .. ?</p>
  
  <p>I tried another way, using an array .. sourcecode is like this:</p>
  
  <pre><code>var array = [];
  array.push("john")
  array.push("jane")
  array.push("foo")
  array.push("bar")
  b(array);
  
  function b(array)
  {
  for(var i = 0; i&lt;(array.length-1); i=i+2)
  {
     document.body.innerHTML= document.body.innerHTML.replace(array[i],array[i+1])
  }
  }
  </code></pre>
  
  <p>but again .. only executes once ..</p>
  
  <p>Am I doing something wrong ?</p>
  
  <p>Because using
  document.body.innerHTML= document.body.innerHTML.replace("foo","bar")
  document.body.innerHTML= document.body.innerHTML.replace("some","one")</p>
  
  <p>works just fine :E</p>