Bind click event to 'search' button in Google Custom Search

前端 未结 1 1284
别那么骄傲
别那么骄傲 2021-01-27 11:03

I am trying to customize a two column Google custom search. I really liked the ajax over iframe which populates a div (default div#cse). But the problem is it pushes the other c

相关标签:
1条回答
  • 2021-01-27 11:55

    The search box is created with google js api after window.onload, therefore the .bind() fails. Solved the problem with jquery.live().

    $("input.gsc-search-button[type=submit]").live('click',showResults);
    $(".gsc-clear-button").live('click', hideResults);
    
    0 讨论(0)
提交回复
热议问题