Dialog error when loading page twice
I have a master page that open a page with links in it to open a dialog . It works fine when the page is loaded the first time, but when I reload the page - it gives me this error:
Uncaught Error: cannot call methods on dialog prior to initialization; attempted to call method 'open'.
This seems simple but I'm stumped, it seems even though I reload the page that the dialog may be stored in DOM of the parent page???? this is all there is:
$(document).ready(function(){
$(function() {
$( "#dialogMgrTERM" ).dialog({
autoOpen: false,
show: {
effect: "blind",
duration: 250
},
hide: {
effect: "blind",
duration: 250
},
close: function() {
$(this).dialog("close");
}
});
$( "#openerMGRterm" ).click(function() {
$( "#dialogMgrTERM" ).dialog( "open" );
});
});
}); //End doc ready