我有一个 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');
}
});
});