admin管理员组文章数量:1292300
I'm not sure what I'm doing wrong but the Google Custom Search I'm setting up on this site I have is not working the way I need it to. What I want is for the results to display within a page, and while the search takes me to the page, the results appear in a popup window for some reason.
This is what I have:
<script>
(function () {
var cx = '[hidden]';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
'//www.google/cse/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
<gcse:searchbox-only linktarget="_self" resultsUrl="/HomePage/Search-Results"></gcse:searchbox-only>
I tried using _parent for linktarget, but that did not solve the issue, either. Is there a way to disable this Google Custom Search from opening results in pop-ups?
I'm not sure what I'm doing wrong but the Google Custom Search I'm setting up on this site I have is not working the way I need it to. What I want is for the results to display within a page, and while the search takes me to the page, the results appear in a popup window for some reason.
This is what I have:
<script>
(function () {
var cx = '[hidden]';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
'//www.google./cse/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
<gcse:searchbox-only linktarget="_self" resultsUrl="/HomePage/Search-Results"></gcse:searchbox-only>
I tried using _parent for linktarget, but that did not solve the issue, either. Is there a way to disable this Google Custom Search from opening results in pop-ups?
Share Improve this question edited Apr 24, 2015 at 14:08 Dejsa Cocan asked Apr 17, 2015 at 14:26 Dejsa CocanDejsa Cocan 1,5693 gold badges20 silver badges59 bronze badges3 Answers
Reset to default 8Go to Google Custom Search Control panel. Select the Search-engine where you generated the Key & Code. Go to Look and Feel, from the sidebar. Change the Layout from 'Overlay'(Popup) to the desire style you need.
You can follow the image to do this -
Click on Look and Feel on the left hand side then choose whatever layout you need. After that click on Save & Get Code
Try changing the linktarget from _self to _parent.
<gcse:searchbox-only linktarget="_parent"
本文标签: javascriptGoogle Custom Search results opening in popup on pageStack Overflow
版权声明:本文标题:javascript - Google Custom Search results opening in popup on page - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741546050a2384600.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论