jQuery replaceWith works but prepend does'nt?
<p>Line of bug is this:</p>

<pre><code>contxt.replaceWith(safe_copy[id]).prepend("&lt;span class='error'&gt;"+jsonObj.data+"&lt;/span&gt;");
</code></pre>

<p>While the <code>replaceWith</code> statement works just fine the data is not getting '<code>prepended</code>'.</p>

<p>A more complete code:</p>

<pre><code>contxt = $(this).parents('div[style^="display"]');
id = $(this).attr('id');

        $.ajax({
                url: "/submit/myposts",
                type: "POST",
                data: "action=edit&amp;post="+$(this).attr('id').match(/[0-9]+/)[0]+"&amp;data="+encodeURIComponent(text),
                success: function(data){
                    loading.remove();
                    jsonObj = $.parseJSON(data);

                    if(jsonObj.code == "0")
                        block.html(jsonObj.data);
                    else
                        contxt.replaceWith(safe_copy[id]).prepend("&lt;span class='error'&gt;"+jsonObj.data+"&lt;/span&gt;");
                },
                error: function(){
                    loading.remove();
                    contxt.replaceWith(safe_copy[id]).prepend("&lt;span class='error'&gt;An error occurred. Please try again.&lt;/span&gt;");
                }
            });
</code></pre>
