我有一个jQuery UI的对话框:jQuery UI的对话框不会打开Internet Explorer中
$("#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');
}
});
});
谢谢,这解决了我的问题! 我也在我的弹出窗口中有一个GIF动画,但它不起作用。你知道这个问题可能会是什么吗? – user1135357 2012-07-12 11:05:52
没有理由不应该工作。你可以看看Chrome的开发工具中的网络标签或Firebug中的网络标签,看看图像是否被请求并正确返回?这可能是一个图像需要预取的问题,您可以通过调用'new Image('path/to/myImage.png');'在JavaScript的早期某处进行预取。 – 2012-07-13 01:03:18