当前位置: 代码迷 >> .NET分析设计 >> 类似于微博评说框加载及实现的小例子。有图有码有真相哦
  详细解决方案

类似于微博评说框加载及实现的小例子。有图有码有真相哦

热度:3546   发布时间:2013-02-25 00:00:00.0
类似于微博评论框加载及实现的小例子。有图有码有真相哦
分快没了。


用的是JQ。

码在这里CSDN的上传不行了今天
------解决方案--------------------------------------------------------

<script src="js/jquery-1.6.min.js" type="text/javascript"></script>

    <script type="text/javascript">
        $(document).ready(function(){
            $("#div_content>a").bind("click", function(){
                var msg=$("#tb_test");
                var oobbj=$(this);//record current command obj
                if(msg.length==0){
                    //if not exit,then get ajaxHTML and append it to the current DOM
                    $.ajax({
                       type: "GET",
                       url: "handle/loadMsgClient.ashx",
                       eache: true,
                       success: function(retrevalue){
                            oobbj.after(retrevalue);
                       },
                       error: function(){
                            alert("参数出错,亲刷新后重试下^_^");
                       }
                    });                
                }
                else{
                    //if exit,then consider two aspects: appended; insertAfter current DOM
                    if(oobbj.next("#tb_test").length!=0){
                        msg.remove();
                    }
                    else{
  相关解决方案