Have just added a Google Custom Search Engine to this blog.
Did start out by going directly to the Google CSE site, putting in my blog address to create an engine, then copying the code. When I came to pasting the code into my blog I realised this was unnecessary as Blogger is a Google "animal" too. Can be done very simply by using the add a gadget option on the blog via Design ----> Layout.
Guess the code would be needed if I was using a different blogging host.
Below is the code I could use:
<script>
(function() {
var cx = '016051726456348803986:gwaupwseopc';
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></gcse:search>
Am wondering if this code would be useful if attempting to integrate an engine into Moodle.
No comments:
Post a Comment