开发者

Google Custom Search, how to run by querystring value?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜