Loading Google Custom Search results without page refresh

前端 未结 2 799
深忆病人
深忆病人 2021-01-23 03:52

I would like to submit a google custom search query without reloading/refreshing the entire html page. I\'m using the latest v2 gcs with the \'Results Only\' layout.

Loa

2条回答
  •  执笔经年
    2021-01-23 04:27

    you need to call

    customSearchControl.execute(urlParams[queryParamName]);

    whenever you need to search. so use that function in onsubmit on form.

    while solving this problem, I have setup it on my own website. you can check it out here.

    Basically I just add submit handler to form via jquery and did all the work that google was doing inside the submit handler. works flawlessly.

提交回复
热议问题