ajax数据字符串拼接,ajax请求到后台数据,前台不用拼接字符串,一样显示到页面...
pageEncoding="utf-8"%>
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
無(wú)標(biāo)題文檔$(document).ready(function() {
//搜索按鈕(全部搜索和按條件搜索)
$("#searchBtn").click(function(){
var itemname = $("#itemname").val();
var year = $("#year option :selected ").val();
//當(dāng)輸入框?yàn)榭?#xff0c;年份沒(méi)選擇,就為搜索全部數(shù)據(jù)
if(itemname =="" && year == undefined){
$.get("/searchAll",
function(data){
$.each(data.tasklist ,function(i,obj){
/* 獲取數(shù)據(jù),添加給模板表格 */
$("#id").text(obj.id);
$("#name").text(obj.name);
$("#type").text(obj.type);
$("#cost").text(obj.cost);
$("#state").text(obj.state);
$("#date").text(obj.date);
/*復(fù)制模板表格,并插入到指定位置*/
$("#temp_tr").clone(true).insertAfter("#is_header");
});
});
}
});
});
| aa | bb | cc | dd | ff | ee | ||
cellpadding="0" cellspacing="0" style="margin-bottom: 4px;">
src="Picture/r.gif" width="16" height="16" />
張宇(學(xué)院申報(bào)者):你好!歡迎光臨,您上次登錄時(shí)間是:2015-09-2023:15:15
cellspacing="0">
src="Picture/b1.jpg" width="10" height="26" />
border="0" align="left" cellpadding="0" cellspacing="0">
width="10" height="16" />
項(xiàng)目搜索src="Picture/b3.jpg" width="9" height="26" />
cellspacing="1" bgcolor="#AEDEF4">
action="/searchByYear">
| 項(xiàng)目名稱: | name="itemname" type="text" id="itemname" size="20" /> | 年份: | 全部 2009 2010 2011 2012 2013 2008 2014 2015 2016 2017 | name="searchBtn" value="搜索" /> |
cellspacing="0">
src="Picture/b1.jpg" width="10" height="26" />
border="0" align="left" cellpadding="0" cellspacing="0">
width="10" height="16" />
項(xiàng)目列表src="Picture/b3.jpg" width="9" height="26" />
cellpadding="3" cellspacing="1" bgcolor="#AEDEF4"
style="border: 1px solid #AEDEF4">
ID項(xiàng)目名稱項(xiàng)目類型申請(qǐng)經(jīng)費(fèi)提交時(shí)間狀態(tài)管理操作?首頁(yè)上一頁(yè) 下一頁(yè)
尾頁(yè) ??轉(zhuǎn)到第?
id=‘jumpSelect‘ type=‘text‘ size=‘2‘ value=‘1‘ />頁(yè)
原文:http://10927283.blog.51cto.com/10917283/1928843
總結(jié)
以上是生活随笔為你收集整理的ajax数据字符串拼接,ajax请求到后台数据,前台不用拼接字符串,一样显示到页面...的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 绝地求生哪个服务器延迟,绝地求生:腾讯公
- 下一篇: wow服务器已满 队列位置5,《魔兽世界