I have created a google search box java script, I have applied it in iWeb, it appears well, but when I make a search it doesn’t respond.
Here is the code:
<!-- Put the following javascript before the closing </head> tag. -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script>
(function() {
var cx = '012476238773441236228:ivxtfsk4-uc';
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>
<!-- Place this tag where you want both of the search box and the search results to render -->
<gcse:search></gcse:search>
Your provided script works (as seen in this jsFiddle). You can safely remove the
<!DocTypemeta tag.e.g.
And in your body, wherever you want your box to appear:
Perhaps you can create a jsFiddle with your current code for debug help?