-1
如何只在一個頁面上添加多個谷歌的搜索結果: 我的代碼是這個代碼不工作..我只希望不依賴特定的標籤搜索框查看結果:多谷歌的搜索結果不僅沒有工作
我想對他們的多個codessome返回一個搜索結果,而忽略第二和他們中的一些不返回任何東西
function gcseCallback() {
if (document.readyState != 'complete')
return google.setOnLoadCallback(gcseCallback, true);
google.search.cse.element.render({ gname: 'gsearch', div: 'results', tag: 'searchresults-only', attributes: { linkTarget: '' } });
var element = google.search.cse.element.getElement('gsearch');
element.execute('Specific tag');
};
window.__gcse = {
parsetags: 'explicit',
callback: gcseCallback
};
(function() {
var cx = '00999830932:uhtgng';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
'//www.google.com/cse/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
<div id="results"></div>
function gcseCallback() {
if (document.readyState != 'complete')
return google.setOnLoadCallback(gcseCallback, true);
google.search.cse.element.render({ gname: 'gsearch', div: 'results22', tag: 'searchresults-only', attributes: { linkTarget: '' } });
var element = google.search.cse.element.getElement('gsearch');
element.execute('Other Tag');
};
window.__gcse = {
parsetags: 'explicit',
callback: gcseCallback
};
(function() {
var cx = '0099983093302884:uhti3ng';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
'//www.google.com/cse/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
<div id="results22"></div>