开发者

Google Custom Search, how to run by querystring value?

开发者 https://www.devze.com 2023-01-21 19:23 出处:网络
Hey I have signed up for the google custom search and its working reasonably well. So basically it generated a Javascript code for me to use.

Hey I have signed up for the google custom search and its working reasonably well.

So basically it generated a Javascript code for me to use.

I was wondering how can I get it to work by also accepting a valu开发者_开发知识库e from querystring ?

Cheers


I've used the following vb.net code to achieve this:

google.load('search', '1', { language: 'en' });
google.setOnLoadCallback(function () {
        var customSearchControl = new google.search.CustomSearchControl('[your se code here]');
        customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
        customSearchControl.draw('cse');
        customSearchControl.execute('<%=server.htmlencode(request.querystring("searchterm"))%>');
     }, true);
0

精彩评论

暂无评论...
验证码 换一张
取 消