1

检查此http://javascript.internet.com/forms/multiple-search-engine.html页面。我想知道如何在适用于 Internet Explorer 的新窗口中打开搜索结果。另外,如何为搜索框设置正文加载。请帮我。这第三次我问,但没有专家能够解决这个问题。在此之前,专家收到了一个解决方案,但它仅适用于 mozilla。帮我。TQ。

4

2 回答 2

3

在您的情况下,表单似乎提交到新选项卡而不是新窗口。可以通过设置新窗口的宽度和高度来强制新窗口,但您必须注意弹出窗口阻止程序可以阻止此操作。另外不要忘记在表单中将 target 属性设置为 _blank,这样您就可以在 js 停用的浏览器中优雅地降级。

<script type="text/javascript">
// frm is a reference to the FORM element
function frm_sbmit(frm) {
    wnd = window.open("about:blank", "_blank", "width=1024px, height=768px, + put here everithing you want in options for the new window, a good guide is http://www.w3schools.com/jsref/met_win_open.asp");
    frm.target = wnd;
    frm.submit();
}
</script>
<form action="url" target="_blank" method="post" onsubmit="frm_sbmit(this);return false;">
...
</form>
于 2010-02-20T14:05:10.160 回答
1

我没有深入研究你的代码,但尝试改变

<form name="searchForm">

进入

<form name="searchForm" target="_blank">

那应该在新窗口中打开它。

于 2010-02-20T13:02:08.387 回答