设置首页  |   加入收藏  |  联系我们   
您的位置: 主页>网站设计>AJAX>正文
Ajax实现无刷新树
文章来源:  编辑:  发布时间:2007-12-14

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);

 
Tags:刷新 实现 iCategoryID id var 100% function el width:

Google
 
上一篇: 利用Asp.net Ajax异步获取xml文档内容   下一篇: Ajax实现在textbox中输入内容,动态从数据库中模糊查询显示到下拉框中
【返回顶部】 【打印】 【大】 【中】 【小】 【关闭】

 我来说两句
用户名: 新注册) 密码: 匿名评论 [论坛讨论]
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 相关文章
 热门文章

 
版权所有  2005-2006  Linux集中营  闽ICP备07500055号