$.ajax({
        type: "GET",
        url: "@Url.Action("EditNote", "Home")",
        data: { id: noteId },
        cache: false,
        dataType: "json",
        success: function (mynote) {
            $("#edit-popup").html(mynote.Html);
            $("#edit-popup").dialog({
                resizable: true,
                height: 210,
                width: 510,
                modal: true,
                buttons: {
                    Save: function () {
                        var boxval = $("#edit-content").val();
                        if (!boxval) {
                            showError("Can't save an empty note");
                            return;
                        }
                        $.ajax({
                            type: "POST",
                            url: "@Url.Action("SaveNote", "Home")",
                            data: { id: noteId, content: boxval },
                            cache: false,
                            dataType: "json",
                            success: function (data) {
                                if (data.Message) {
                                    showError(data.Message);
                                } else {
                                    $(liId).replaceWith(data.Html);
                                    $(liId).slideDown("slow");
                                    $("#flash").hide();
                                    $("#edit-popup").dialog("close");
                                }
                            }
                        }); //end save call
                    }, // end ok button
                    Cancel: function () {
                        $("#flash").hide();
                        $(this).dialog("close");
                    }
                },
                close: function () {
                    $("#flash").hide();
                } //end buttons
            }); //end modal edit
        }
    }); //end ajax call
On success after the dialog closes I need it to update the dynamic content that was loaded I am using the replaceWith() but it does not change the content, what am i doing wrong, I am really really new at this.
