Appending jQuery using jQuery
<p>So apparently I'm trying to do something that jQuery does not like.</p>

<p>I'm using javascript to upload pictures. Every time a picture is uploaded I want it to be visible as well as have a working remove script attached to it. The display works fine, the remove does not because it does not exist on the page when I inspect it with firebug.</p>

<p>This is the script for removing the file:</p>

<pre><code>var insertScript = "&lt;";
insertScript += "script type='text/javascript'&gt;jQuery(document).ready(function($){ $('#Remove_" +
    file + "').click(function() { removeImage(\"" +
    fileName +"\", \""+ imageUID +"\", \"" +
    file + "\"); }); });";
    insertScript += "&lt;";
    insertScript += "\/script&gt;";
</code></pre>

<p>In my page I have a div tag that holds all the images, so I am appending to it every time an image is uploaded  as such:</p>

<pre><code>jQuery(document).ready(function($) {
    $('#ImageBar').append(insertScript);
    $('#ImageBar').append(insertHTML);
});
</code></pre>

<p>The insertHTML variable holds a div tag with the image inside of it and a remove button. No javascript/jquery in it. It appends fine. The insertScript does not append at all. </p>

<p>I tried on a hunch to remove the jQuery from the insertScript and replace it with a simple javascript alert and test if it was the tags that mess it up, and it's not. The alert worked fine when appended. Which leads me to believe that jQuery does not like appending jQuery. Is there another way of going about doing this?</p>
