SCRIPT5009: 'google' is undefined

2019-08-03 09:07发布

This is my first time working with wordpress and I'm using the version 3.4.1. Since I used http://www.google.com/cse/, my website http://www.unicos.cc stoped working on IE. It starts loading and loading, but if you take a look on scripts you get this error:

<script defer onreadystatechange='google.loader.domReady()' src=//:></script>

SCRIPT5009: 'google' is undefined 
www.unicos.cc, line 1 character 1

I'm using this script on my header.php:

<script>
  (function() {
    var cx = '000262504839720845383:sqkphv1egay';
    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>

And this code to call the function on my page-buscar.php (page-search):

<gcse:search></gcse:search>

You can take a look at the website. My code is there, waiting for your help. And so am I.

Thanks for your patience!

1条回答
ら.Afraid
2楼-- · 2019-08-03 09:37

Your site is still blank in IE.

Maybe you should switch your Custom search engine to V1:

http://www.google.com/cse/ >> Get code >> "Switch to Search Element V1 code"

http://productforums.google.com/forum/#!topic/customsearch/ZIwVtE2i73E

查看更多
登录 后发表回答