我在做一個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