Google Custom Search v2无法加载Ajax

时间:2013-04-08 08:03:16

标签: ajax search google-custom-search

我正在将我的网站更改为ajax + pushstate技术,我遇到了一些问题。

我已经设法修复了twitter,facebook和google +按钮,但我找不到重新加载Google自定义搜索框的功能。

这是我现在正在使用的代码:

<script>
(function() {
var cx = 'google_search_id';
var gcse = document.createElement('script'); gcse.type = 'text/javascript'; gcse.async = false;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
    '//www.google.com.br/cse/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gcse, s);
})();
</script>

0 个答案:

没有答案