2013-11-27 4 views
0

이 코드는 약 2 개월 전에 사용되었습니다. 사용 중지 된 것으로 알고 있지만 몇 달 전인 10 월 초 (2013)와 같이 정상적으로 작동했습니다. Google에서 API를 다시 변경 했습니까?Google 사이트 검색이 결과를 반환하지 않습니다.

google.load('search', '1'); 

function OnLoad() { 
    // Create a search control 
    var searchControl = new google.search.SearchControl(); 

    // Add in a WebSearch 
    var webSearch = new google.search.WebSearch(); 

    // Restrict our search to pages from the Cartoon Newtowrk 
    webSearch.setSiteRestriction('stmikes.utoronto.ca'); 

    // Add the searcher to the SearchControl 
    searchControl.addSearcher(webSearch); 

    // tell the searcher to draw itself and tell it where to attach 
    searchControl.draw(document.getElementById("content")); 

    // execute an inital search 
    searchControl.execute('SMC'); 
} 

google.setOnLoadCallback(OnLoad); 

HTML은

<div id="content">Loading...</div> 

답변