!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" html xmlns="http://www.w3.org/1999/xhtml" head meta http-equiv="Content-Type" content="text/html; charset=utf-8" / titl 无标题文档 输入要翻译的内容: <br /> google.load("language", "1");<br /> google.setOnLoadCallback(init); <p> function init() {<br /> <br /> var value = document.getElementById('txtDictSearch').value;<br /> var src = "zh-CN";<br /> var dest = "en";<br /> google.language.translate(value, src, dest, translateResult);<br /> } <p> function translateResult(result) {<br /> var resultBody = document.getElementById("gresult");<br /> if (result.translation) {<br /> var str = result.translation.replace('>', '>').replace('<', '<');<br /> resultBody.innerHTML = str;<br /> } else {<br /> resultBody.innerHTML = '对不起,暂时还没有收录此词';<br /> }<br /> } <p>