Ajax实现无刷新树

网络整理 - 07-26

1.建立一个aspx页面
html代码
<html xmlns="" >
<head id="Head1" runat="server">
    <title>小山</title>
    <link type="text/css" href="../../Styles/tree_css/tree.css" rel="stylesheet">
</head>
<body>
    <form id="Form1" runat="server">
    <table width=100% cellpadding=0 cellspacing=0 border=0>
        <colgroup>
            <col width=180 />
            <col />
        </colgroup>
        <tr>
            <td>
                <div class="TreeMenu" id="CategoryTree" style="width: 100%; height: 489px">
                </div>
            </td>
            <td>
                <iframe id=furl height=20 style="height: 497px; width: 100%;"></iframe>
            </td>
        </tr>
    </table>   
                           
            <script language="jscript">
            function el(id)
            {
                return document.getElementById(id);               
            }
            function ExpandSubCategory(iCategoryID)
            {
                var li_father = el("li_" + iCategoryID);
                if (li_father.getElementsByTagName("li").length > 0) //分类已下载
                {
                    ChangeStatus(iCategoryID);
                    return;
                }
               
                li_father.className = "Opened";
               
                switchNote(iCategoryID, true);
                AjaxMethod.GetSubCategory(iCategoryID, GetSubCategory_callback);               
            }

            function GetSubCategory_callback(response)
            {
                var dt = response.value.Tables[0];
                if (dt.Rows.length > 0)
                {
                    var iCategoryID = dt.Rows[0].FatherID;