3
Google建議以XML表的形式在線提供,例如,這些建議是關於字堆棧的建議:XML results by Google。這裏是一個截斷版本:Google XML建議
<toplevel>
<CompleteSuggestion>
<suggestion data="stack overflow"/>
<num_queries int="25200000"/>
</CompleteSuggestion>
<CompleteSuggestion>
<suggestion data="stackable washer dryer"/>
<num_queries int="1050000"/>
</CompleteSuggestion>
<CompleteSuggestion>
<suggestion data="stacked"/>
<num_queries int="57000000"/>
</CompleteSuggestion>
…
</toplevel>
我想在我的網站上放置一個輸入字段,並在輸入時得到建議。我如何獲得XML並在我的網站上顯示它像普通的HTML(文本)?
(我能做到這一點與jQuery?)
是的,你可以使用jQuery。尋找自動完成插件。 – 2011-12-15 10:18:07