0

I have a jquery code to delete my contents as follow:

$(document).ready(function () {

$(".delete").click(function () {
        var jobId = $(this).attr('value');

        $(".deleteItem").dialog({
            resizable: false,
            height: "auto",
            width: 400,
            modal: true,
            buttons: {
                "Confirm Delete": function () {
                    $(this).dialog("close");
                    $.ajax({
                        type: "POST",
                        url: "http://localhost/deleteItem",
                        data:
                        {
                            jobId: jobId
                        },
                        dataType: "html",
                        success: function (response) {
                            $("#ajaxContent").html(response);
                            setTimeout(loadData, 1000);
                        }
                    });

                },
                Cancel: function () {
                    $(this).dialog("close");
                }
            }
        });



    });

{);

the problem is after the ajax content loads, I am trying to call this same function again from the responded content but it does not work.

I tried to copy this same script onto the response file but then 2 dialog boxes appear instead when I clicked on it.

Can anyone help me to put it in use the right way? Thanks

dan
  • 729
  • 2
  • 16
  • 26

0 Answers0