亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

jquery在啟動(dòng)頁(yè)面時(shí),自動(dòng)加載數(shù)據(jù)的實(shí)例

 更新時(shí)間:2018年01月22日 15:18:49   作者:星空下的那個(gè)人影  
下面小編就為大家分享一篇jquery在啟動(dòng)頁(yè)面時(shí),自動(dòng)加載數(shù)據(jù)的實(shí)例,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧

其實(shí),重要的就是這個(gè)方法:

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

具體的在jquery中:

具體的ajax怎么使用,可以查看我的上一篇博客《淺談ajax在jquery中的請(qǐng)求和servlet中的響應(yīng)

<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>序號(hào)</th>
     <th>業(yè)主名</th>
     <th>聯(lián)系方式</th>
     <th>時(shí)間</th>
     <th>地址</th>
     <th>項(xiàng)目描述</th>
     <th>狀態(tài)</th>
     </tr>
    </table>
    </div>
 </div>

以上這篇jquery在啟動(dòng)頁(yè)面時(shí),自動(dòng)加載數(shù)據(jù)的實(shí)例就是小編分享給大家的全部?jī)?nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論