SCRIPT5009: 'google' is undefined

半城伤御伤魂 提交于 2019-12-11 09:29:37

问题


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:


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



来源:https://stackoverflow.com/questions/11940872/script5009-google-is-undefined

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!