这是我实现的代码,这是我的 Bing 应用程序详细信息
client ID = pacific__tycoon,
client secret == qCtCnigQ1afu8qi705ldOQ3IGy0rabMgHvVL+GU5Xww=
Name == pacificty--coon
我想要一个像http://bunkerhill.com/这样的翻译器,因为它也可以在我的网站上运行在 iphone 中。
还有其他解决方案吗?
<script src="jquery-mobile/jquery.translator-1.1.0.min.js"></script>
<script type="text/javascript" >
jQuery(document).ready(function ($) {
$.ajax(
{
url: "Default.aspx/GetBingAppId",
type: 'post',
dataType: "json",
data: "{}",
contentType: "application/json; charset=utf-8",
success: function (bingid) {
return $("p,h1,h2,span,li,a,.xlatext,.clients").translator({ appID: bingid.d, languageListNode: $('#languages').get(0), callback: xlatDone });
},
error: function (x, err, desc) {
alert('madharchodError getting Bing ID: ' + err + ' - ' + desc);
}
}
);
});
function xlatDone(charsXlated) {
if (charsXlated === 0) return;
$.ajax(
{
type: 'POST',
url: 'Default.aspx/SaveCharactersTranslated',
contentType: "application/json; charset=utf-8",
data: "{charsXlated:" + charsXlated + "}"
}
);
}
</script>
<div id="languages" style="overflow:hidden; font-size:smaller;" title="Language Translation"></div>