年代轉換(YearConvert)-取得朝代年號之起迄年區間
朝代: 年號(必填):
(遼,天顯、金,天德、元,至大、明,萬曆)



範例程式碼(詳細請點右鍵觀看原始碼):
<script type="text/javascript" src="http://ccts.sinica.edu.tw/api/CCTS_API.js"> <script>
function getYI ()
{
var pYearConv = new YearConvert();
var aa = "";
pYearConv.getyearinterval(document.getElementById("yearinterval1").value, document.getElementById("yearinterval2").value, function (result, status) {
if(result != "")
{
aa = "起" + result["startdate"] +" ~ 迄"+ result["enddate"]
document.getElementById("view").innerHTML = aa;
}
else
{
document.getElementById("view").innerHTML = status;
}
});
}
</script>