开发者

How to open another URL in a different window when a html page is loaded?

I have one html page, with a form on it. When the user posts the form, 开发者_高级运维I want the form receiving the response to automatically open up the URL passed by the post in a new browser window.

Basically the URL is passed to the the other page, which in turn opens the URL in a new window then displays another form.

Thanks in advance.

Cheers

Shane


Add target="_blank" attribute to the <form>.

<form action="http://google.com/search" target="_blank">
    <input type="text" name="q" />
    <input type="submit" />
</form>

This will show the response in a new (blank) window. Note that this happens before the HTML page is loaded (it wouldn't make much sense otherwise).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜