I've added a search engine in my site using the google's custom search engine. I chose the two page layout because I what I want is that the search box will be at the homepage and its result will be shown in another page. But it won't work on mine. Whenever I try to search something it won't show results and it won't go to the page. What will I do? Please help me. Thank you.
for search box
<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>
for results
<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>
Aucun commentaire:
Enregistrer un commentaire