年表查詢(YearTableQuery)
朝代(必填): (清,明,唐,金)

範例程式碼(詳細請點右鍵觀看原始碼):
<script type="text/javascript" src="http://ccts.sinica.edu.tw/api/CCTS_API.js"> <script>
function getYT ()
{
var aa = "";
var pYearQuery = new YearTableQuery();
pYearQuery.getYearTable({ dynasty: document.getElementById("YT").value }, function (result, status) {
for(var i = 0; i < result[0]["fieldAttr"].length; i++)
{
if(result != "")
{
for(var i = 0; i < result[0]["fieldAttr"].length; i++)
{
aa += status + result[0]["fieldAttr"][i] + "<br>";
}
document.getElementById("view").innerHTML = aa;
}
else
{
aa += status;
document.getElementById("view").innerHTML = aa;
}
}
document.getElementById("view").innerHTML = aa;
});
}
</script>