Javascript 使用angular的Google翻译API
我已经将google translation API与我的angular应用程序集成。早些时候,它工作得很好,但现在当我尝试翻译网站上的内容时,我遇到了“about:invalid#zClosurez”错误。有人能告诉我可能是什么问题吗?以下是供您参考的示例代码:Javascript 使用angular的Google翻译API,javascript,angular,google-api,google-translation-api,Javascript,Angular,Google Api,Google Translation Api,我已经将google translation API与我的angular应用程序集成。早些时候,它工作得很好,但现在当我尝试翻译网站上的内容时,我遇到了“about:invalid#zClosurez”错误。有人能告诉我可能是什么问题吗?以下是供您参考的示例代码: <html> <head> <title>My Page</title> <meta http-equiv="Content-Type&qu
<html>
<head>
<title>My Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div class="translate">Тестирование</p>
<div class="translate_control" lang="en"></div>
<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>
</body>
</html>
我的页面
ааааа
函数googleSectionalElementInit(){
新的google.translate.SectionalElement({
sectionalNodeClassName:'翻译',
controlNodeClassName:“翻译\u控件”,
背景:“#f4fa58”
}“谷歌元素”;
}
我在网上找到了下面的小提琴例子,它和我的问题是一样的。当您点击“翻译”按钮时,它会尝试将您导航到“关于:无效的#zClosurez”地址
我认为此问题与中发现的w3school代码片段错误有关 不过,我想补充一点;我认为使用这个端点不是一个好的做法,因为它没有正式的文档记录,因此似乎不打算稳定使用 根据,您应该使用的服务端点是:或者您还可以查看