jQuery局部刷新的实现
来源:互联网 发布:淘宝中国一号白银店铺 编辑:程序博客网 时间:2024/06/10 00:22
一、在一个页面上通过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 >
原理
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 >
- jQuery局部刷新的实现
- JQuery实现局部刷新
- JQUERY实现局部刷新
- JQuery的Ajax请求实现局部刷新
- jquery实现的Ajax局部刷新
- jquery实现页面局部刷新
- jquery实现页面局部刷新
- jquery实现页面局部刷新
- MVC2 与 JQuery 的 Ajax 实现局部刷新的问题
- 使用jquery的load()方法实现页面局部刷新
- JQuery的Ajax请求实现局部刷新 小案例
- jquery ajax 实现标签容器内的局部刷新
- jQuery实现局部刷新的几种方式
- 通过jQuery实现Ajax局部刷新
- js 和Jquery 实现Ajax 局部刷新
- jQuery实现AJAX定时局部页面刷新
- jQuery实现AJAX定时局部页面刷新
- 前端jquery 后端 thinkphp 实现局部刷新
- 使用tcmalloc的一些问题
- 优秀平面设计师是怎样炼成的
- swf 格式Flash 动画播放器在Android上的实现
- JSR-303规范,Bean Validation
- 书写格式
- jQuery局部刷新的实现
- Expect安装方法
- MVVM 的使用
- 愚蠢的矿工--树形动态规划
- ASP.net 类库中获得当前路径的方法(非页面中)
- hdu 1285——确定比赛名次(拓扑排序)
- WinForm中,Button按钮有PerformClick()方法,可以模拟用户单击鼠标. 即button.PerformClick()生成按钮的事件。
- 最小公倍数
- SQL Server之分布式事务.