如何在 IE 中运行的 javascript 搜索引擎在新窗口中打开搜索结果页面?

发布于 2024-08-22 11:08:12 字数 313 浏览 10 评论 0原文

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

Check this http://javascript.internet.com/forms/multiple-search-engine.html page. I wonder how to open search result in new window which works for Internet Explorer. Also, how to set body onload for the searchbox. Please help me. This third times i asked but there's no expert able to solve this. Before this, an expert was sent a solution but it works just for mozilla only. Help me. TQ.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

合久必婚 2024-08-29 11:08:12

在您的情况下,表单似乎提交到新选项卡而不是新窗口。可以通过设置新窗口的宽度和高度来强制打开新窗口,但您必须注意弹出窗口阻止程序可以阻止此操作。另外不要忘记在表单中将 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>

It seems that in your case the form submits into a new tab instead a new window. The new window can be forced by setting the width and height of the new window, but you must be aware that popup blockers can prevent this action. Also don't forget to set the target attribute to _blank in the form so you can degrade gracefully in browsers with js deactivated.

<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>
难理解 2024-08-29 11:08:12

我没有深入研究您的代码,但尝试更改

<form name="searchForm">

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

应该在新窗口中打开它。

I haven't delved into your code deeply, but try changing

<form name="searchForm">

into

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

that should open it in a new window.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文