javascript
  • google-cse
  • 2013-04-22 3 views 0 likes 
    0

    내 Google 맞춤 검색이 영구히 멈추었습니다. 나는 크롬 콘솔에서 얻을 JS 오류는 다음과 같습니다Google 맞춤 검색 JS 구문 오류

    Uncaught TypeError: Object [object Object] has no method 'enableSearchBoxOnly' 
    

    내 코드 : 사전에 어떤 도움

    <div class="search"> 
    <div id='cse-search-form' style='width: 100%;'>Loading</div> 
    </div> 
    <script src='//www.google.com/jsapi' type='text/javascript'></script> 
    <script type='text/javascript'> 
    google.load('search', '1', {language: 'es', style: google.loader.themes.DEFAULT}); 
    google.setOnLoadCallback(function() { 
    var customSearchOptions = {}; 
    var customSearchControl = new google.search.CustomSearchControl('003806993800906102968:1a2oqwxzgqk', customSearchOptions); 
    customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET); 
    var options = new google.search.DrawOptions(); 
    options.enableSearchBoxOnly('https://www.globalsign.es/buscar', 'q'); 
    customSearchControl.draw('cse-search-form', options); 
    }, true); 
    </script> 
    

    감사합니다!

    답변

    2

    API ReferenceenableSearchBoxOnly이 잘못 대문자임을 나타냅니다.

    options.enableSearchboxOnly('https://www.globalsign.es/buscar', 'q'); 
    

    대문자 "b"로 시작하는 대신 시도하십시오.

    options.enableSearchBoxOnly('https://www.globalsign.es/buscar', 'q'); 
            ^
    
    +0

    감사합니다. 그건 정말 나쁘다, 그들은 내 사이트에서 잘못된 코드를 주었다 ... – Barney

    +0

    @ 바니, 나는 그들과 함께 버그를 제기합니다. 샘플 코드를 어디에서 발견했는지 알 수 있습니까? –

    +0

    그래, Google 맞춤 검색 페이지 - 검색 엔진의 V1에서 가져온 것입니다. 나는 이번 주에 버그를 제기 할 것이다 :) – Barney

     관련 문제

    • 관련 문제 없음^_^