我想用自定义html内容打开弹出式窗口IE浏览器。使用提供Can I open a new window and populate it with a string variable?页用IE浏览器自定义html内容打开新窗口
我用下面的JavaScript的答案片段:
var wnd = window.open("about:blank", "", "");
wnd.document.write(htmlContent);
wnd.document.close();
这段代码打开一个新标签,而不是一个弹出窗口的内容,所以我用了额外的参数_blank作为如下:
var wnd = window.open("about:blank", "", "_blank");
wnd.document.write(htmlContent);
wnd.document.close();
现在,一个弹出我的内容打开,但它没有滚动条,不调整大小,没有菜单,由于其印刷是不可能的。我已经尝试过的一种方法是使用windowfeatures参数,如下所示:
var strWindowFeatures =
"menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes";
var wnd = window.open("about:blank", strWindowFeatures, "_blank");
wnd.document.write(htmlContent);
wnd.document.close();
但是使用此参数对结果弹出窗口没有影响。另外,在Chrome中,弹出窗口没有内容。我怎么解决这个问题?