欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

試用google search的Ajax api

 更新時間:2006年09月06日 00:00:00   作者:  
最近兩個月訪問google老抽風,也8知道偉大的GFW使了些什么手段。雖然形式不容樂觀,仍然是看到了狗狗發(fā)布了google adsense api和google search ajax api,顯然后者更具有實用價值。因此俺用迅雷不及掩耳盜鈴之勢申請了api key,在參考了online manual之后,還是用實際代碼說話吧:
復制代碼 代碼如下:

function OnLoad() {
        // Create a search control
        var searchControl = new GSearchControl();

        // 搜索選項,這里設置為自動展開 
        var options = new GsearcherOptions();
        options.setExpandMode(GSearchControl.EXPAND_MODE_OPEN);

        // 添加了一個網頁搜索
        searchControl.addSearcher(new GwebSearch(), options);

        // 搜索結果輸出選項,列表顯示 GSearchControl.DRAW_MODE_TABED是另外一個選項,tab方式顯示各種搜索結果
        var drawOptions = new GdrawOptions();
        drawOptions.setDrawMode(GSearchControl.DRAW_MODE_LINEAR);

        // 每次顯示8條搜索結果
        searchControl.setResultSetSize(GSearch.LARGE_RESULTSET);
        // Tell the searcher to draw itself and tell it where to attach
        searchControl.draw(document.getElementById("searchcontrol"), drawOptions);

        // 開始搜索
        searchControl.execute("Google");
    } 

目前這個api的版本是0.1,正式版1.0發(fā)布之后,搜索結果將會有廣告顯示,顯然這個午餐不免費。

http://code.google.com/apis/ajaxsearch/documentation/#AdvancedSamples

相關文章

最新評論