googleTranslateElementInit 不适用于 Opera
<div id="google_translate_element" >
<script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'en'
}, 'google_translate_element');
}
</script>
</div>
<script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
这是我翻译语言的脚本。它在除 Opera 之外的所有浏览器上都能正常工作。会有什么问题呢?对chnage语言有什么新的建议吗?
<div id="google_translate_element" >
<script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'en'
}, 'google_translate_element');
}
</script>
</div>
<script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
This is my script to translate language. It works fine on all browsers except opera. What would be the problem? Any new suggesation to chnage language ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
试试这个:
(http://translate.google.com/translate_tools)
source
其实用之前定义的回调函数会更好使用过,如您的帖子中所示。
另一件事是,当你打开translate.google.com opera的控制台时,它会显示它已经修改了一些js。因此,其他域上的行为可能会有所不同,例如根本不起作用,就像我的情况一样。 :(
Try this:
(http://translate.google.com/translate_tools)
source
Actually it is better with the callback function defined before it is used, as in your post.
One more thing, when you open translate.google.com opera's console states that it has modified some of the js. So the behavior on other domains might be different, e.g. not working at all, as in my case. :(
这永远行不通。尝试将脚本放在其他一切之前
This never could work. Try to put script before everything else