Javascript 在新窗口中打开搜索结果

Javascript 在新窗口中打开搜索结果,javascript,php,html,Javascript,Php,Html,如何在新窗口上打开搜索结果。这段代码有什么问题。 它将打开新选项卡,但不处理结果 <form action="hhtp://google.com/search" method = "get" target="_blank"> <input type ="text" name="q"/> <input type ="submit" value = "search> </form> 您的操作属性(hhtp而不是http)中存在输入错误 <f

如何在新窗口上打开搜索结果。这段代码有什么问题。 它将打开新选项卡,但不处理结果

<form action="hhtp://google.com/search" method = "get" target="_blank">
<input type ="text" name="q"/>

<input type ="submit" value = "search>
</form>


您的
操作
属性(hhtp而不是http)中存在输入错误

<form action="hhtp://google.com/search" method = "get" target="_blank">
<input type ="text" name="q"/>

<input type ="submit" value = "search>
</form>
回答: 谢谢你在评论中有答案

<form action="hhtp://google.com/search" method = "get" target="_blank">
<input type ="text" name="q"/>

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

编辑1: 如果要执行web搜索,建议使用

<form action="hhtp://google.com/search" method = "get" target="_blank">
<input type ="text" name="q"/>

<input type ="submit" value = "search>
</form>
编辑2:
您可能会想到使用AJAX来执行帖子或访问Google的搜索表单/页面,但由于CSRF(),这也行不通。

您为什么要将get发送到Google?或者谷歌只是一个占位符?为什么表格周围有星星?另外,您在url中指定了hhtp而不是http,并且在=符号周围有许多额外的空格。我认为谷歌可能希望你使用https;也许是一篇博文而不是get,但如果你查看他们搜索页面的来源,你可能会发现。那么正确的代码是什么?@AliUppal不幸的是,我不是这方面的专家,但我已经用谷歌搜索API的链接更新了答案。谢谢你的帮助:)@AliUppal这很可能是你的第一个问题,因此,如果您对答案感到满意,请接受它;)
target=“\u blank”仅适用于锚点,它可以在新窗口中为我打开。
<form action="hhtp://google.com/search" method = "get" target="_blank">
<input type ="text" name="q"/>

<input type ="submit" value = "search>
</form>