vle*_*sha 5 html google-translate
我正在尝试在我的网站中嵌入Google Translate代码段,但由于某种原因它甚至都没有显示.我去这里: 谷歌工具
复制这个:
<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>
Run Code Online (Sandbox Code Playgroud)
将其粘贴到我的网页上.而我在那里也看不到它.
我错过了什么?有些HTML可能吗?
这是一个有效的例子.我想你错过了"&ug = section&hl = {LANGUAGE}"参数:
我的页面Тестирование
<script>
function googleSectionalElementInit() {
new google.translate.SectionalElement({
sectionalNodeClassName: 'translate',
controlNodeClassName: 'translate_control',
background: '#f4fa58'
}, 'google_sectional_element');
}
</script>
<script src="//translate.google.com/translate_a/element.js?cb=googleSectionalElementInit&ug=section&hl=en"></script>
Run Code Online (Sandbox Code Playgroud)
http://jsfiddle.net/maxim75/H3Wkr/ - 工作实例
| 归档时间: |
|
| 查看次数: |
35481 次 |
| 最近记录: |