Skip to content

Instantly share code, notes, and snippets.

@PardotGists
Created September 28, 2015 13:21
Show Gist options
  • Save PardotGists/76c45d1e5028dd739d13 to your computer and use it in GitHub Desktop.
Save PardotGists/76c45d1e5028dd739d13 to your computer and use it in GitHub Desktop.
Integrating Google Site Search Example 1
<script>
(function() {
var cx = 'YOUR_GOOGLE_SEARCH_ENGINE_ID_HERE';
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment