0
我正在使用谷歌自定义搜索在我的网站。它为我工作得很好。唯一的问题是它显示弹出结果而不是我给定的网址这里是我的代码。谷歌自定义搜索结果显示弹出而不是页面在PHP中
<div class="navbar-right" id="search-bar" >
<script>
(function() {
var cx = '006045053715355086088:qma4ulxxwhu';
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:search resultsUrl="http://localhost/barbadosparliament/result/index/"></gcse:search>
</div>
任何人都可以请告诉我为什么它显示我的结果弹出?
那么,有什么区别?我看到了一个'linktarget =“_ parent”';还有什么改变? – wallyk
如果您尝试使用'cx = 003074870824758447082:b7qmpwpireg'它会在同一窗口中显示结果。我认为这取决于自定义搜索引擎规范 – nilashan
请访问以下链接:https://productforums.google.com/forum/#!msg/customsearch/o4loA9VEfX0/RbIz8XiNc50J – nilashan