问题
I use dialogs in my app. But I have run to some problems during optimizing my page for IE. In my document.ready
function, I call this
$("#DFormExport").dialog({
resizable: true,
modal: false,
autoOpen: false,
width: 750
});
to inicialize my dialog and then when user hits the button I call this, because the type of buttons in mydialog depends on some user choice
$("#DFormExport").dialog("option", "buttons", {
"Vytisknout": function () {
loading(1);
tiskText($("#DExportCo").attr("href"),"", $("#DExportCo").attr("rm"));
},
Zrušit: function () {
$(this).dialog("close");
}
}).dialog('option', 'title', 'Vytisknout');
In chrome and FF everything works just fine, but in IE i am getting cannot call methods on dialog prior to initialization; attempted to call method 'option'
So any ideas how to solve this?
回答1:
So I have finally find a sollution. To fix the IE bug, I have just simply saved the dialog to variable during the creaion var dialog=$("#DFormExport").dialog({...})
and then I call dialog.dialog("option", "buttons", {....})
instead
来源:https://stackoverflow.com/questions/15626675/cannot-call-methods-on-dialog-prior-to-initialization-attempted-to-call-method