拼音轉換:
請輸入轉換文字(字與字之間請加空白做分隔):


請輸入來源拼音:     
請輸入欲轉換拼音:  

範例程式碼(詳細請點右鍵觀看原始碼):
<script type="text/javascript" src="http://ccts.sinica.edu.tw/api/CCTS_API.js"></script>
<script>
var getUnit = function () {
document.getElementById("view").innerHTML = "";
var pQuery = new UnitConvert();
var sP, tP;
switch(document.getElementById("SourcePinyin").value)
{
case "hanyoue":
sP = pQuery.pinyinId.hanyoue;
break;
case "wg":
sP = pQuery.pinyinId.wadegiles;
break;
case "general":
sP = pQuery.pinyinId.general;
break;
}

switch(document.getElementById("TargetPinyin").value)
{
case "hanyoue":
tP = pQuery.pinyinId.hanyoue;
break;
case "wg":
tP = pQuery.pinyinId.wadegiles;
break;
case "general":
tP = pQuery.pinyinId.general;
break;
}
pQuery.getPinyinval({
SourcePinyin: sP, //來源拼音
TargetPinyin: tP, //目標拼音
Pinyinval: document.getElementById("Pinyinval").value //數值
},function(result, status){
if (result != "" && result != null) {
document.getElementById("view").innerHTML += "換算結果:" + result + "," + status;
}
else {
document.getElementById("view").innerHTML = status;
}
});
}
</script>