Modal Pop Up Loading Twice

Hi Everyone,

I hope someone could help me with this issue. When I click on a link a modal pop up comes up the problem is that the pop up is loading twice. I’ve been searching online but I haven’t been able to solve this issue. Here is the code

$(function () {
    var iframe = $('<iframe frameborder="0" marginwidth="0" marginheight="0" allowfullscreen></iframe>');
    var dialog = $("<div></div>").append(iframe).appendTo("body").dialog({
        autoOpen: false,
        modal: true,
        resizable: false,

        width: "auto",
        height: "auto",
        close: function () {
            iframe.attr("src", "");
        }
		
    });
    $(".thumb a").on("click", function (e) {
        e.preventDefault();
        var src = $(this).attr("href");
        var title = $(this).attr("data-title");
        var width = $(this).attr("data-width");
        var height = $(this).attr("data-height");
        iframe.attr({
            width: +width,
            height: +height,
            src: src
        });
        dialog.dialog("option", "title", title).dialog("open");
		
    });
});

echo '<ul class="thumb"><li><a href="view_record.php?cid=' . $row['case_no'] . '" data-title="View Record For: ' . $row['client_name'] . '" data-width="910" data-height="330">View</a></li></ul>';

Hi,

Could you post a link to a page where I can see this happening?