재우니의 블로그


<title>Untitled Page</title>
<meta http-equiv="content-type" content="text/html; charset=euc-kr" />
    <script src="_scripts/jquery-1.2.6.js" type="text/javascript"></script>

    <script language="javascript">
        $(document).ready(function() {
            $("#ddlStates").change(function() {
                $("#ddlCities").html("");
                var StateID = $("#ddlStates > option[@selected]").attr("value");
                if (StateID != 0) {
                    $.getJSON('LoadCities.asp?StateID=' + StateID, function(cities) {
                        $.each(cities, function() {
                            //$("#ddlCities").append("<option value=" + this['ID'] + ">" + this['City'] + "</option>");

                            $("#ddlCities").append($("<option></option>").val(this['ID']).html(this['City']));

                        });
                    });
                }
            });

        });
    </script>


<td>
            

<select ID="ddlStates">
<option selected="selected" value="WriteUserName">이름</option>
<option value="Title">제목</option>
<option value="MobileContent">내용</option>
<option value="WriteDate">날짜</option>
            </select>
        </td>
        </tr>
        <tr>
        <td>Cities</td>
        <td>
            <select ID="ddlCities">
            </select>
        </td>


asp단에서는..


<%@LANGUAGE="VBSCRIPT" CODEPAGE="949"%>
<% Response.CharSet = "euc-kr" %> 
<%
StateID = request("StateID")
If StateID = "Title" then
response.write "[{""City"":""Chennai"",""ID"":""1""},{""City"":""Coimbatore"",""ID"":""2""}]"
Else
response.write "[{""City"":""권판진"",""ID"":""1""},{""City"":""바부팅이"",""ID"":""2""}]"
End If 
%>



두개 파일을 ANSI 로 저장해서 실행해야 한다.