javascript - Auto-translate a web page, using Google Translator -
i'm need modify code, in order automatically translate web page, (if it's possible) hide button translation:
<div id="google_translate_element"></div> <script type="text/javascript"> function googletranslateelementinit() { new google.translate.translateelement({pagelanguage: 'zh-cn', includedlanguages: 'bg', layout: google.translate.translateelement.inlinelayout.simple, autodisplay: false, multilanguagepage: true}, 'google_translate_element'); } </script> <script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googletranslateelementinit"></script>
this i've tried:
<script type="text/javascript"> function change() { settimeout(function() { $(".goog-te-combo").val("bg").get(0).dispatchevent(document.createevent("htmlevents").initevent("change", !0, !0)) }, 3000) } change(); </script>
this error get:
uncaught typeerror: cannot read property 'dispatchevent' of undefined
Comments
Post a Comment