JQuery function: prepend <form> that calls another JQuery function
<p>Long time reader - first time poster.</p>

<p>I got this JQuery function and I'm trying to execute it it from another JQuery function:</p>

<pre><code>$(".delete_item").click(function() {
    var element = $(this);
    var Id = element.attr("id");
    var split = Id.split('_');
    var row = 'row_' + split[1];

    var dataString = 'item=' + split[1];

    $.ajax({
        type: "POST",
        url: "_remove.jsp",
        data: dataString,
        success: function() {

           removeRow(row);

        }

    });
</code></pre>

<p>The problem that I'm having is when I'm using prepend in the success: function() of another function, trying to call this function. It doesn't work:</p>

<pre><code>$("#table")
    .prepend($('&lt;tr&gt;')
        .prepend($('&lt;td&gt;')
            .prepend($('&lt;form&gt;')
                .attr('method','post')
                .attr('id','delete_1234')
                .attr('name','delete_1234')
                .prepend($('&lt;input&gt;')
                    .attr('type', 'image')
                    .attr('name','Delete')
                    .attr('src', 'images/button_delete.gif')
                    .attr('class','delete_item')
                    .attr('id','delete_1234')
                )
            )
        )
</code></pre>

<p>The function (the first one) that I'm trying to call from within the success function works fine when used from the html page, but not when calling it from prepend. In stead of calling the 'delete_item' class function, it just reloads the page. Hopefully I'm making myself understandable and someone has an idea of how to get around this.</p>

<p>Thanks</p>
