只需改变searchControl.execute("abc");语句中的关键词(abc)就可以改变google
ajax搜索页面显示的搜索结果。简直就是傻瓜式的。
=========================================================
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
google.load("search", "1.0");
function OnLoad() {
// Create a search control
var searchControl = new google.search.SearchControl();
// Add in a full set of searchers
searchControl.addSearcher(new google.search.WebSearch());
searchControl.addSearcher(new google.search.VideoSearch());
searchControl.addSearcher(new google.search.BlogSearch());
searchControl.addSearcher(new google.search.NewsSearch());
searchControl.addSearcher(new google.search.ImageSearch());
// tell the searcher to draw itself and tell it where to attach
var drawOptions = new google.search.DrawOptions();
drawOptions.setDrawMode(google.search.SearchControl.DRAW_MODE_TABBED);
searchControl.draw(document.getElementById("searchcontrol"), drawOptions);
// execute an inital search
searchControl.execute("abc");
}
google.setOnLoadCallback(OnLoad, true);
//]]>
</script>
<div id="searchcontrol"> Loading </div>
=========================================================
0 comments:
发表评论