Word Replacement with jquery
<p>Thanks in advance for the help.</p>

<p>I have been fooling around with browser extensions (a novice) and I have been trying to figure out some word swapping issues; specifically, I am trying to do something akin to a <a href="http://en.wikipedia.org/wiki/Rebus" rel="nofollow">rebus</a>.</p>

<p>I tested my code out on just a plain text page, and it works.  But then, when making it an extension, it basically loses the styling on the page and turns it into text only.</p>

<p>I have been looking for a more unobtrusive way to swap a word like "shoe" with an image of a shoe. I have been working in jQuery and using the documentation to make what I already did below.  </p>

<pre><code>$(document).ready(function () {
    var newText = $("body").text().split(" "); 
    $.each(newText, function(index, value) {
        if (newText[index] === "shoe") {
            newText[index] = "&lt;img src='http://.../shoe.png' alt='shoe'&gt;";
        }
    });
    var altText = newText.join("&lt;/span&gt; &lt;span&gt;");
    $("body").html(altText);
});
</code></pre>

<p>I see what I am doing: ripping the text out and then shoving back in.  But I am at a loss of what I should use.  </p>

<p>I am aware of the <code>replaceWith()</code> function and I suppose that is the right one to use.  But how do I get to the "shoe" words in the first place? </p>

<p>Thanks</p>
