• 局部刷新的实现


    一、在一个页面上通过ajax加载其他的页面来实现异步的效果

    原理

  • ajax(url,param,success);   
  • function success(msg){   
  •  $("#某个div").html(msg);   
  • }  
  •  searcher.aspx   

      <script type="text/javascript">  

            function sub(){   

                var params=$("#receiptForm").serialize();   

                $.ajax({   

                    type:"POST",   

                    url:"list.aspx",   

                    data:encodeURI(params),   

                    dataType:"html",   //返回页面的html源码

                    success:function(data){    

                        $('div').html(data);   

                    },   

                    error:function(){    

                    }   

                });   

            }   

        </script>  

      </head>  

      <body>  

        <form id="receiptForm"  >  

           产品名称:<input type="text"  name="name"/><br/>  

            产品型号:<input type="text" name="no"/><br/>  

            <input type="submit" name="search"/>  

        </form>  

        <div id="list"></div>  

     </body>  

    </html>  

    list.aspx    根据传递的参数来获取产品信息展现出一个列表的形式的局部html代码,不是一个完整的页面

    <table   >  

          <tr>   

              <th>1</th>   

               <th>2</th>   

                <th>3</th>   

                <th>4</th>   

                <th>5</th>   

                <th>6</th>   

                <th>7</th>   

                <th>8</th>   

                <th>9</th>   

                <th>10</th>                

            </tr> 

     <asp:Repeater>

    ……

     </asp:Repeater>

     </table >  

  • 相关阅读:
    关于项目中 "不能创建大小为 8190 的行,该大小大于所允许的最大行大小 8060 "的处理
    sql 使用with 递归
    ssh,安全验证的级别(来自BD百科)
    Windows系统自带路由命令Route add,解决双网卡网络流向问题
    irreversiblecipher和cipher区别(华为交换机)
    Centos7重置root密码(20220527 02:03测试可用)
    2022中级财务管理相关公式的总结
    移动端软键盘顶出nav
    React.Component生命周期
    Axure 9 单选效果
  • 原文地址:https://www.cnblogs.com/linzheng/p/1858963.html
  • Copyright © 2020-2023  润新知