这是我的代码。
function gcseCallback() {
// key to search
var key = $("#txtkeyword").val();
if (document.readyState != 'complete')
return google.setOnLoadCallback(gcseCallback, true);
google.search.cse.element.render({ webSearchResultSetSize: 'small', gname: 'gsearch', div: 'google-search', tag: 'searchresults-only', attributes: { linkTarget: '_blank' } });
var element = google.search.cse.element.getElement('gsearch');
element.execute(key);
};
(function () {
var cx = 'xxxxx:xxxx';
var gcse = document.createElement('script'); gcse.type = 'text/javascript'; gcse.async = true;
gcse.src = (document.location.protocol == 'https' ? 'https:' : 'https:') +
'//www.google.com/cse/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gcse, s);
})();发布于 2015-01-14 11:14:01
https://www.google.com/cse/search/advanced
网络搜索限制-->结果大小(0 - 20)
https://stackoverflow.com/questions/26671106
复制相似问题