views:

449

answers:

1

Is it possible to combine Ajax post with jQuery UI dialog? And I want to process the ajax reponse in JSON to HTML for showing inside the Dialog box

var url = AJAX_URL+requestId+'/'+userId;
// Need to POST the requestId and userId instead of GET

$("body").append("<div id='dialog-modal'>Loading...</div>");
$("#dialog-modal").dialog("destroy");
$("#dialog-modal").load(url).dialog({
    modal:   true,
    title:   "Update Status",
    buttons: {
        Cancel: function() {
            $(this).dialog('close');
        },
        Update: function() {
            // Do something
        }
    }
});
+1  A: 

You can change it to POST by providing data as an object.

For example:

$("#dialog-modal").load(url, {"requestId": requestId, "userId": userId})
Sam