我們可以使用谷歌AJAX語言API與EXTjs? 我試圖例如用於翻譯,我有一個HTML文件:Extjs與谷歌Ajax語言Api
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<link rel="stylesheet" type="text/css" href="F:\vaishali.g\ext-3.1.0\resources\css\ext-all.css"/>
<script type="text/javascript" src="F:\vaishali.g\ext-3.1.0\adapter\ext\ext-base.js"></script>
<script type="text/javascript" src="F:\vaishali.g\ext-3.1.0\ext-all.js"></script>
<script type="text/javascript" src="F:\vaishali.g\ext-3.1.0\ext-all-debug.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript" src="F:\vaishali.g\Assignments\EXTJS\typemarathi.js"></script>
</HEAD>
<body>
Type in Hindi (Press Ctrl+g to toggle between English and Hindi)<br>
<input type="text" id="myid" name="myname">
</body>
</HTML>
和typemarathi.js
的google.load( 「元素」, 「1」,{ 包: 「音譯」 } );
function onLoad() {
var options = {
sourceLanguage:
google.elements.transliteration.LanguageCode.ENGLISH,
destinationLanguage:
[google.elements.transliteration.LanguageCode.MARATHI],
shortcutKey: 'ctrl+g',
transliterationEnabled: true
};
// Create an instance on TransliterationControl with the required
// options.
var control =
new google.elements.transliteration.TransliterationControl(options);
// Enable transliteration in the editable DIV with id
// 'transliterateDiv'.
control.makeTransliteratable([myname]);
}
google.setOnLoadCallback(onLoad);
它工作正常。但是,如果我寫的ExtJS
Ext.onReady(function(){
var form1=new Ext.FormPanel({
renderTo:document.body,
frame:true,
title:'My First Form',
widyh:250,
items:[{
xtype:'textfield',
fieldLabel:'First name',
name:'firstname'
}
]
});
});
的文本框,並嘗試通過姓名(名稱屬性control.makeTransliteratable([名字])) 那麼它不工作...它說:「無效的ID錯誤」。但如果我通過 - >(HTML文本文件名到它)control.makeTransliteratable([myname])它工作正常。
是的,你可以。你爲什麼不這樣想?這個問題需要更詳細的闡述。 – flybywire 2010-02-25 12:17:03
連續多次?或!!=自動downvote – hobodave 2010-02-25 16:49:33