使用bing或google來翻譯網頁
阿新 • • 發佈:2018-08-30
-html ogl -s creat auto 插入 tag amp child
google代碼:在</head>之後插入
<meta name="google-translate-customization" content="4bd8dffe75af5007-16fa37f088724895-g08c0457d35008bb8-47"></meta>
並在要顯示按鈕的地方插入如下代碼:
<div id="google_translate_element"></div><script type="text/javascript">function googleTranslateElementInit() { new google.translate.TranslateElement({pageLanguage: ‘en‘, includedLanguages: ‘zh-CN‘, layout: google.translate.TranslateElement.InlineLayout.SIMPLE}, ‘google_translate_element‘);}</script><script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
bing代碼:
<div id=‘MicrosoftTranslatorWidget‘ class=‘Light‘ style=‘color:white;background-color:#555555‘></div><script type=‘text/javascript‘>setTimeout(function(){{var s=document.createElement(‘script‘);s.type=‘text/javascript‘;s.charset=‘UTF-8‘;s.src=((location && location.href && location.href.indexOf(‘https‘ ) == 0)?‘https://ssl.microsofttranslator.com‘:‘http://www.microsofttranslator.com‘)+‘/ajax/v3/WidgetV3.ashx?siteData=ueOIGRSKkd965FeEGM5JtQ**&ctf=False&ui=true&settings=Auto&from=en‘;var p=document.getElementsByTagName(‘head‘)[0]||document.documentElement;p.insertBefore(s,p.firstChild); }},0); </script>
使用bing或google來翻譯網頁