谷歌自定义搜索,如何通过查询字符串值运行?
-
26-09-2019 - |
题
嘿,我已经签署了谷歌的自定义搜索和它的合理运作良好。
因此,基本上它生成的Javascript代码为我使用。
我想知道如何可以通过我还从查询字符串接受的值得到它的工作?
干杯
解决方案
我用下面vb.net代码来实现这一点:
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);
不隶属于 StackOverflow