我发送一个 Ajax 请求,结果是一个使用数据表 jquery 插件呈现的表格。如果响应成功,我将打开一个新窗口并在那里显示结果。这在 FF 中完美运行,但在 IE 8 中失败。IE 抛出对象预期错误。由于某种原因,它无法识别 jquery 库。但是,如果我刷新 IE 页面一次,它将成功呈现表格。 我在这里错过了什么吗?当我在 IE 中打开一个新窗口时有什么不同?
function openResult (html){
var output = window.open("",null, "resizable=1,scrollbars=1,status=1,toolbar=0,menubar=0,location=0");
if (window.focus) {output.focus()}
output.document.open();
output.document.write(html);
output.document.close();
return false;
};
.....
$.ajax({
type: "POST",
url: "${g.createLink(action: 'search' )}?&time="+ date,
data: dataString,
success: function(response) {
$("#displayBox").hide()
openResult(response)
//$('#listTemplateDivId').html(response) ;
$.unblockUI()
}
});
最佳答案
@ThiefMaster 感谢您的建议。我最终使用了 colorbox 并且它工作得很好。
关于javascript - Internet Explorer 不会显示带有嵌入式 jquery 的呈现的 gsp,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7177052/