jquery (javascript) refresh div
<p>Bear with me. I recently started implementing jquery at work. I created a new app already so I do have an understanding of what goes but I have not fully grasped it yet.</p>

<p>I have this function below that is being called everytime someone clicks a checkbox in a table wrapped in a unique div id. Currently, the table does not refresh until you close the dialog box. I want the div to refresh after the the server finishes its request.</p>

<p>I got it to work only for the first row in the table by simply calling the displayMid function again (that is commented out in the code below).</p>

<p>How do I get this to work for all the table rows? You can see I have been trying a few things already.  ;-)</p>

<p>Any help is appreciated! Thanks!</p>

<pre><code>function addRemoveMid(count, testpid) {
        var x = testpid;
        var y = $("#Mid" + count).text();
        var a = $("#midcheckbox" + count).is(':checked');
        //alert(x);
        if (!$("#midcheckbox" + count).is(':checked')) {
            $.ajax({
                url: "content_backend_pub_pid.ashx",
                data: { cmd: '10', pid: x, mid: y },
                type: "get",
                async: false,
                success: function(o) {
                    //displayMid(count);
                    //$("#inputDiv4").replaceWith($('#inputDiv4', $(html)));
                }
            });
            //$(this.addRemoveMid(count);
        }
        else {
            $.ajax({
                url: "content_backend_pub_pid.ashx",
                data: { cmd: '9', pid: x, mid: y },
                type: "get",
                async: false,
                success: function(o) {
                    //displayMid(count);
                    //$("#inputDiv4").replaceWith($('#inputDiv4', $(html)));
                }
            });
            //displayMid(count);
        }
        //$("#inputDiv4").fadeOut("fast").html('reload.php').fadeIn("fast");
    }
</code></pre>
