我需要使用java脚本window.open打开新的浏览器窗口,我有html页面,但由于找不到页面而出现错误。这是来自jsf/icefaces。我直接显示了html页面。请帮助我.. .
JavascriptContext.addJavascriptCall(FacesContext.getCurrentInstance(),
"window.open('printerFriendly.html','Print',,'width=300','height=200','menubar=yes',
'status=yes','location=yes','toolbar=yes','scrollbars=yes')");
最佳答案
尝试这样的事情:
<FORM>
<INPUT type="button" value="New Window!" onClick="window.open('http://stackoverflow.com','mywindow','width=400,height=200,toolbar=yes,
location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,
resizable=yes')">
</FORM>
它采用表单形式,但任何其他链接的 JS 代码都是相同的。
关于javascript - 如何使用javascript打开新的浏览器窗口?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3616709/