<html>
<head>
<title>以「非同步傳輸」進行樹狀選歌</title>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=big5">
<style>
td {font-family: "標楷體", "helvetica,arial", "Tahoma"}
A:link {text-decoration: none}
A:hover {text-decoration: underline}
</style>
<script src="prototype.js"></script> <!-- include file -->
<script>
// 顯示查詢結果
function show_language_Result(xmlHttpObj){
Element.update('song_language', xmlHttpObj.responseText); //將option寫入下拉式選單的裡面
//document.write("xmlHttpObj.responseText="+xmlHttpObj.responseText);
}
// 送出對資料庫的查詢
function check_language() {
var url = 'find_song_language.asp'; // 伺服器的程式網頁
//var queryString = 'singerName=' + $F('singerName'); // 參數列
var ajax = new Ajax.Request(url, {method:'post', onComplete:show_language_Result});
}
</script>
</head>
<body onload="check_language()">
<h2 align=center>以「非同步傳輸」進行樹狀選歌</h2>
<hr>
<FORM Name="myForm">
<table align=center border=1>
<tr>
<th>歌曲語言
<th>歌手名字
<th>歌曲清單
</tr>
<tr>
<td align=center>
<SELECT size=10 id="song_language" OnChange="Renew(this.selectedIndex);">
</Select>
<td align=center>
<!-- We want to define at least one option so that the select tag is created
with the correct dimensions-->
<SELECT Name="Member" size=10 OnChange="Renew2(this.selectedIndex);">
<OPTION Value="">--------------
</Select>
<td align=center>
<SELECT Name="Song" size=10 OnChange="Renew3(this.selectedIndex);">
<OPTION Value="">----------------------
</Select>
</tr>
<tr><td colspan=3 align=center>Midi 網址:<input type=text size=60></td></tr>
<tr><td colspan=3 align=center><input type=button value=音樂欣賞 onClick="document.location='http://n...content-available-to-author-only...u.tw/jang2/cbmr/datafile/midifile/國語_女/張惠妹/聽海.mid'"></td></tr>
</table>
</Form>
<hr>
<script>function viewSource() {window.location="view-source:"+window.location} </script>
檢視原始碼:
[<a target=_blank href="/jang/books/webprog/common/showcode.asp?source=/jang/books/asp/exerciseTemplate/selectSong01.asp">Server-side script</a>]
[<a href="javascript:viewSource()">Client-side script</a>]
</html>