【发布时间】:2012-07-12 09:40:58
【问题描述】:
我有一个 jQuery UI 对话框:
$("#dialog").dialog({
modal: true,
closeOnEscape: false,
resizable: false,
autoOpen: false,
open: function() {
$(".ui-dialog-titlebar").hide();
}
});
我试图在 AJAX 调用之前打开此对话框。它可以在 Firefox 中使用,但在 IE 中无法打开,除非我在打开对话框之后输入alert。谁能告诉我可能是什么问题?我正在使用以下代码:
$("button").click(function() {
$("#dialog").dialog('open');
//alert('test'); //if I put this alert, the dialog will open
$.ajax({
type: "POST",
url: "testing.txt",
async: false,
dataType: "text",
success: function(returnText) {
$("#dialog").dialog('close');
$("#textarea").text(returnText);
},
error: function() {
$("#dialog").dialog('close');
}
});
});
【问题讨论】:
标签: ajax jquery-ui internet-explorer dialog