$('.Editcoupon').click(function() { var strRef = ''; var strid = ''; var strSelectedval = ''; strRef = $(this).attr('ref'); strid = $(this).attr('id'); strqueryvalue = $(this).attr('ref').match(/Defaultcoupon=([0-9]+)/)[1]; $("#Coupondialog-modal" + strid + strSelectedval).dialog("destroy") $("").appendTo('body'); $("#Coupondialog-modal" + strid + strqueryvalue).dialog({ width: 750, height: 502, resizable: false, autoOpen: false, //buttons: { "close": function() { $(this).dialog("close"); } },
modal: true
});
$("#Coupondialog-modal" + strid + strqueryvalue).load();
$("#Coupondialog-modal" + strid + strqueryvalue).dialog('open');
});
the above is code to open a UI dialog of jquery where iframe is dynamically injected to body tag,which on click of a href tag ,for first time iam able to open dialog & close ,again when iam trying to open dialog ,close it using below code
window.parent.$("#Coupondialog-modalloadcoupons" + offerid+count ).dialog('close');
it is not closing the dialog ,event fires which on click of the button in iframe.
can any one please guide me ?