【发布时间】:2014-10-22 05:16:41
【问题描述】:
我刚刚为我的网站创建了 Google 自定义搜索。有两部分代码:搜索框和搜索结果。我将第一个代码插入到正文标记中,但搜索框没有出现在网站上。
我做错了什么?!
<body>
<div>
<script>
(function() {
var cx = '004556147665872853919:poyz6b7kmfw';
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></gcse:searchbox>
</div>
【问题讨论】:
标签: javascript html css search