I am using google custom search in my site. It wis working fine for me. Only problem is it shows me results in popup instead of my given url Here is my code.
<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>
Can anyone please tell me why it is shows me results in popup ?
You can use like this:
<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 linktarget="_parent" resultsUrl="http://localhost/barbadosparliament/result/index/"></gcse:search>