关于javascript问题!谢谢大家啦!

Kote 2009-05-11 07:24:33
我想定义一个函数 funciong picture(x){}
请问怎么将x加入到google的图片搜索(http://images.google.cn/imghp?hl=zh-CN&tab=wi)窗口的文本框中,并自动查找。
也就是我想用这个函数完成将形参的值在google图片搜索的功能。调用这个函数时要直接看到结果!
谢谢啦!!!
...全文
64 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
natineprince 2009-05-11
  • 打赏
  • 举报
回复
把=号后面的加到
window.open("这里")
就行了..
Kote 2009-05-11
  • 打赏
  • 举报
回复
感谢各位的回答,但那个picture(x)函数,执行后能不能让它再打开一个新窗口呢?谢谢大家的帮助。
caiying2009 2009-05-11
  • 打赏
  • 举报
回复

<input type="button" value="图片搜索" onclick="picture('春')">
<script language="javascript">
<!--
function picture(x){
window.location.href="http:\/\/images.google.cn\/images?hl=zh-CN&q="+x+"&btnG=%E6%90%9C%E7%B4%A2%E5%9B%BE%E7%89%87&gbv=2&aq=x&oq="
}
//-->
</script>


grearo 2009-05-11
  • 打赏
  • 举报
回复
funciong picture(x)
{
location.href='http://images.google.cn/images?hl=zh-CN&q='+x+'&btnG=%E6%90%9C%E7%B4%A2%E5%9B%BE%E7%89%87&gbv=2&aq=f&oq=';
}
natineprince 2009-05-11
  • 打赏
  • 举报
回复

<form action="http://images.google.cn/images" name=f target="_blank">
<input name=hl type=hidden value=zh-CN>
<input autocomplete="off" maxlength=2048 name=q size=40 title="搜索图片" value="">
<input name=btnG type=submit value="搜索图片">
</form>


直接把这段放在你的网页就能搜了.

87,919

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧