JavaScript scan for words and make into link
<p>I need pure JavaScript to use an array of specified words and URLs to read a webpage and convert any matching words into links. The Google Gods have neglected to return any helpful examples:( Any help would be great!</p>

<p>I found this on a site somewhere :</p>

<pre><code>FUNCTION linkWord(obj){
  FOR(i IN obj){
    VAR x = document.body.innerHTML;
    VAR linkStart = '&lt;a href="'+obj[i]+'"&gt;';     
    VAR linkEnd = '&lt;/a&gt;';     
    VAR reg = NEW RegExp ('\\b' + i + '\\b','g');
    x = x.replace(reg, linkStart + i + linkEnd);
    document.body.innerHTML = x;
  }
}

linkWord ({
  'funny':'http://www.example.com',
  'another':'http://icant.co.uk'
});
</code></pre>
