<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>Google AJAX Language API - Basic Translation</title> <mce:script type="text/javascript" src="http://www.google.com/jsapi" mce_src="http://www.google.com/jsapi"></mce:script> <mce:script type="text/javascript"><!-- google.load("language", "1"); function initialize() { google.language.translate("Happy new year!", "en", "zh-CN", function(result) { if (!result.error) { var container = document.getElementById("translation"); container.innerHTML = result.translation; } }); } google.setOnLoadCallback(initialize); // --></mce:script> </head> <body> <div id="translation"></div> </body> </html>
谷歌的在线翻译API
最新推荐文章于 2025-10-16 21:16:25 发布
本文介绍如何使用Google AJAX Language API实现跨语言的基本翻译功能,通过简单的代码示例展示了从英语到中文的翻译过程。
1485

被折叠的 条评论
为什么被折叠?



