将google.com加载到我的网站

时间:2012-03-29 18:22:41

标签: php javascript html iframe

我想将google.com加载到我网站的页面中。 我尝试使用iframe,但google.com不起作用。

<iframe src="http://www.google.com"></iframe>

没用。

如何将google.com的内容加载到我的页面? 我不在乎解决方案是使用PHP,JavaScript还是简单的HTML。

我知道iframe无法正常工作,我试图找到解决方法。

编辑: 我想要加载孔页面。这不仅仅是为了娱乐而钓鱼。我想找到一种围绕iframe块的方法。

2 个答案:

答案 0 :(得分:1)

如果您想要显示提交给Google的搜索输入,可以选择以下方式:http://www.google.com/cse/tools/create_onthefly

但请不要忘记,这不包括Google到您的网站 - 这只是一个将用户发送给Google的表单。他将不再在你的网站上了。

答案 1 :(得分:0)

我相信这可能有不同的选择,但通常只想拥有搜索框,而不是整页。

在您的网站上嵌入Google搜索框的一种简单方法是使用以下标记:

<form method="get" action="http://www.google.com/search">

<div style="border:1px solid black;padding:4px;width:20em;">
<table border="0" cellpadding="0">
<tr><td>
<input type="text"   name="q" size="25"
 maxlength="255" value="" />
<input type="submit" value="Google Search" /></td></tr>
<tr><td align="center" style="font-size:75%">
<input type="checkbox"  name="sitesearch"
 value="yourwebsite.com" checked />Search on yourwebsite<br />
</td></tr></table>
</div>

</form>

正如您所看到的,甚至可以选择让Google将搜索限制在您的网站上。不幸的是,结果将重定向到谷歌本身,它们不会嵌入您的网站,我不确定他们的使用政策是否允许这样做。

希望有所帮助,祝你好运。