我在做一个website。当你点击我的搜索框然后输入你点击搜索,然后它把你带到搜索结果的google.com如何在输入框架时使用ajax显示结果?当你在http://google.com上搜索你输入的文本通过其自我而不按搜索结果我怎么能做到这一点?这是我的html片段在我的网站上的Google自动搜索结果
<div class='search'>
<form method="get" id='search' action="http://www.google.com/search">
<input type="hidden" name="q" size="31" maxlength="255" value="Site Name:" />
<input type="text" name="q" size="31" maxlength="255" style="height: 24px;" placeholder="Search..." />
</div>
我有很多的CSS后面它使文本框放大和改变颜色。这里是相关的代码片段。
#search input[type="text"] {
background: url(imgs/search-white.png) no-repeat 10px 6px #444;
border: 0 none;
font: bold 12px Arial,Helvetica,Sans-serif;
color: #d7d7d7;
width:150px;
padding: 6px 15px 6px 35px;
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 20px;
text-shadow: 0 2px 2px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 3px rgba(0, 0, 0, 0.2) inset;
-moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 3px rgba(0, 0, 0, 0.2) inset;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 3px rgba(0, 0, 0, 0.2) inset;
-webkit-transition: all 0.7s ease 0s;
-moz-transition: all 0.7s ease 0s;
-o-transition: all 0.7s ease 0s;
transition: all 0.7s ease 0s;
outline: none;
}
#search input[type="text"]:focus {
background: url(imgs/search-dark.png) no-repeat 10px 6px #fcfcfc;
color: #6a6f75;
width: 175px;
-webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(0, 0, 0, 0.9) inset;
-moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(0, 0, 0, 0.9) inset;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(0, 0, 0, 0.9) inset;
text-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
outline: none;
}
div.search
{
position:fixed;
top:8px;
right:5px;
}
因此,如何让我的ajax框架显示谷歌搜索结果,你键入? 我什么都不知道AJAX我不知道如何开始行与它的代码ither所以请在深入解释
*侧面说明 如果对不起网站看起来坏的IM 13
非常感谢我更新了它如何使iframe显示仅当文本框被点击? – 2013-02-10 04:40:57
可能最简单的方法是这样做:http://jsfiddle.net/TqhCZ/ – Stephen 2013-02-10 04:55:39
哦,你可能会想提交你的网站到谷歌他们索引,它看起来不像他们已经。 http://www.google.com/webmasters/tools/submit-url – Stephen 2013-02-10 04:58:45