Linux中国 Linux中国门户站!
设为主页 设为主页
收藏本站 收藏本站
 
当前位置 :首页 ->网站设计 ->AJAX教程 ->正文

Ajax实现无刷新树

来源:Linuxdby.com 作者:Webmaster 时间:2007-06-04 点击: [收藏] [投稿]

1.建立一个aspx页面
html代码
<html xmlns="http://www.w3.org/1999/xhtml" >
<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;
                }
                var li_father = el("li_" + iCategoryID);

 如果您对本文有任何疑问或者建议,请到讨论区发表您的意见: >> 论坛入口 <<



上一篇:利用Asp.net Ajax异步获取xml文档内容   下一篇:Ajax实现在textbox中输入内容,动态从数据库中模糊查询显示到下拉框中

文章评论】 【收藏本文】 【推荐好友】 【打印本文】 【我要投稿】 【论坛讨论
更多相关文章
Power by linux-cn.com 粤ICP备05006655号