0
我在我的網站中使用谷歌的自定義搜索引擎添加了搜索引擎。我選擇了兩個頁面佈局,因爲我想要的是搜索框將位於主頁,其結果將顯示在另一個頁面中。但它不適用於我的。每當我嘗試搜索某些內容時,它都不會顯示結果,也不會進入該頁面。我能做什麼?請幫幫我。謝謝。Google搜索引擎兩個頁面佈局不起作用
搜索框
<script>
(function() {
var cx = 'XXXXXXXX:XXXXXXX';
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>
<gcse:searchbox-only></gcse:searchbox-only>
的結果
<script>
(function() {
var cx = 'XXXXXXXX:XXXXXXX';
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>
<gcse:searchresults-only></gcse:searchresults-only>