如何在 Durundal Shell.js 、 shell.html 中绑定 Google 翻译?
html
<div id="google_translate_element"></div>
script
<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
function googleTranslateElementInit() {
new google.translate.TranslateElement({ pageLanguage: 'en', autoDisplay: false }, 'google_translate_element');
}
请参阅 Durandal 的合成功能:http://durandaljs.com/documentation/Using-Composition/ http://durandaljs.com/documentation/Using-Composition/
Example:
<div>
<div data-bind="compose:'views/google_translate.html'"></div>
</div>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)