简体   繁体   中英

Google translate dropdown not working in IE7 and IE9

Here is the code I am using to add the drop down in the page.

<script type="text/javascript">
     function googleTranslateElementInit() {
        new google.translate.TranslateElement({
             pageLanguage: 'en',
             //includedLanguages: 'zh-CN,zh-TW,es'
        }, 'google_translate_element');
     }
</script>

<script type="text/javascript" src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>

Please let me know.

Looks like you are missing the div to display the dropdown? Try this:

    <div id="google_translate_element"></div><script>
function googleTranslateElementInit() {
  new google.translate.TranslateElement({
    pageLanguage: 'en'
  }, 'google_translate_element');
}
</script><script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM