最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

jquery在启动页面时,自动加载数据的实例

来源:懂视网 责编:小采 时间:2020-11-27 22:21:17
文档

jquery在启动页面时,自动加载数据的实例

jquery在启动页面时,自动加载数据的实例:其实,重要的就是这个方法: $(document).ready(function(){ } 具体的在jquery中: 具体的ajax怎么使用,可以查看我的上一篇博客《浅谈ajax在jquery中的请求和servlet中的响应》 <script type=text/javascript>
推荐度:
导读jquery在启动页面时,自动加载数据的实例:其实,重要的就是这个方法: $(document).ready(function(){ } 具体的在jquery中: 具体的ajax怎么使用,可以查看我的上一篇博客《浅谈ajax在jquery中的请求和servlet中的响应》 <script type=text/javascript>

其实,重要的就是这个方法:

$(document).ready(function(){ 
} 

具体的在jquery中:

具体的ajax怎么使用,可以查看我的上一篇博客《浅谈ajax在jquery中的请求和servlet中的响应》

<script type="text/javascript">
 $(document).ready(function(){
	var str = "";
	var strA = "";
 $.ajax({
 	type: "GET",
 	 url: "<%=path%>" + "/queryOrder.do",
 	 dataType: "json",
 	 async:false,
 	 data:{
 	 	 
 	 	 },
 	 success: function(data){
 	 	for (var i in data)
 	 	{
 	 	var num = parseInt(i) + 1;
 	 	var status = data[i]['status'];
 	 	if( status == 0 || status == -4){
 	 	strA = '<a class="m1" value="'+ data[i]['orderId'] +'">未处理</a>';
 	 	}else if( status == -1 || status == -2){
 	 	strA = '<a class="m2" value="'+ data[i]['orderId'] +'">已接受</a>';
 	 	}else if( status == -3){
 	 	strA = '<a class="m3" value="'+ data[i]['orderId'] +'">已完成</a>';
 	 	}
 	 	str +="<tr><td>" + num + "</td><td>" 
 	 	+ data[i]['ownerName'] + "</td><td>"
 	 	 + data[i]['telephone'] + "</td><td>" 
 	 	+ data[i]['hopeTimeName'] + "</td><td>" 
 	 	+ data[i]['build'] + "</td><td>"
 	 	+ data[i]['description'] + "</td><td>"
 	 	+ strA + "</td>";
 	 	+ "</tr>";
 	 	}
 	 	$(".tabletr").after(str);
 	 },
 	 error: function(data){
 	 	
 	 }
 	}) 	
 	});
</script>

在jsp中:

<div class="tab-pane active" id="A" style="text-align:center;">
 <div class="row marg" >
 <h3>维修单</h3>
 <table border="2 " style="width:100%;text-align:center;">
 <tr class="tabletr">
 	<th>序号</th>
 <th>业主名</th>
 <th>联系方式</th>
 <th>时间</th>
 <th>地址</th>
 <th>项目描述</th>
 <th>状态</th>
 </tr>
 </table>
 </div>
 </div>

以上这篇jquery在启动页面时,自动加载数据的实例就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持脚本之家。

文档

jquery在启动页面时,自动加载数据的实例

jquery在启动页面时,自动加载数据的实例:其实,重要的就是这个方法: $(document).ready(function(){ } 具体的在jquery中: 具体的ajax怎么使用,可以查看我的上一篇博客《浅谈ajax在jquery中的请求和servlet中的响应》 <script type=text/javascript>
推荐度:
标签: 页面 示例 实例
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top