0

In Weebly's HTML/CSS editor, I am having an issue with the Google Translate dropdown option (Language in English, Spanish) appearing in the editor preview but not on the live website.

I copied and pasted the code directly from Google Translate into the header page of our website using the Edit HTML/CSS function. This is the code:

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

The dropdown appeared on the live website before, but isn't working now.

I tried viewing the live website with different browsers like Chrome, IE, and Safari, and none of them show the language dropdown. This happened across my computer and my co-worker’s, on both Mac and PC.

I also checked Adobe Flash in case the plugin version was the issue and I have the most up-to-date version (11).

Any suggestions on where I could look would be appreciated.

4

1 回答 1

0

我不确定你是否找到了答案我看到你在 5 个月前发布了这个。我遇到了同样的问题,这似乎与 weebly 加载脚本的方式有关,这导致它不会出现在已发布的站点中。

我解决此问题的方法是执行以下操作。

1)添加当您编辑weebly模板CSS时将两个脚本添加到Header之间的所有内容之间,应该在和之间

2) 将这个 div 标签放在你想要添加下拉列表的地方。

于 2016-06-22T14:47:10.417 回答