通過(guò)Jquery的Ajax方法讀取將table轉(zhuǎn)換為Json
更新時(shí)間:2014年05月31日 16:57:46 作者:
這篇文章主要介紹了通過(guò)Jquery的Ajax方法讀取將table轉(zhuǎn)換為Json,需要的朋友可以參考下
1. 創(chuàng)建Users表
create table Users
(
UserId int identity(1,1) primary key,
UserName varchar(20)
)
insert into Users values('Bradley')
insert into Users values('Dan')
create table Users
(
UserId int identity(1,1) primary key,
UserName varchar(20)
)
insert into Users values('Bradley')
insert into Users values('Dan')
2. 創(chuàng)建JsonHelper類(lèi)
public class JsonHelper
{
#region 序列化和反序列化
// 序列化
public static string JsonSerializer<T>(T t)
{
// 使用 DataContractJsonSerializer 將 T 對(duì)象序列化為內(nèi)存流。
DataContractJsonSerializer jsonSerializer = new DataContractJsonSerializer(typeof (T));
MemoryStream ms = new MemoryStream();
// 使用 WriteObject 方法將 JSON 數(shù)據(jù)寫(xiě)入到流中。
jsonSerializer.WriteObject(ms, t);
// 流轉(zhuǎn)字符串
string jsonString = Encoding.UTF8.GetString(ms.ToArray());
ms.Close();
//替換Json的Date字符串
string p = @"\\/Date\((\d+)\+\d+\)\\/";
MatchEvaluator matchEvaluator = new MatchEvaluator(ConvertJsonDateToDateString);
Regex reg = new Regex(p);
jsonString = reg.Replace(jsonString, matchEvaluator);
return jsonString;
}
public static T JsonDeserialize<T>(string jsonString)
{
//將"yyyy-MM-dd HH:mm:ss"格式的字符串轉(zhuǎn)為"\/Date(1294499956278+0800)\/"格式
string p = @"\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}";
MatchEvaluator matchEvaluator = new MatchEvaluator(ConvertDateStringToJsonDate);
Regex reg = new Regex(p);
jsonString = reg.Replace(jsonString, matchEvaluator);
DataContractJsonSerializer jsonSerializer=new DataContractJsonSerializer(typeof(T));
// 字符串轉(zhuǎn)流
MemoryStream ms=new MemoryStream(Encoding.UTF8.GetBytes(jsonString));
// 通過(guò)使用 DataContractJsonSerializer 的 ReadObject 方法,將 JSON 編碼數(shù)據(jù)反序列化為T(mén)
T obj = (T) jsonSerializer.ReadObject(ms);
return obj;
}
public static string ConvertJsonDateToDateString(Match match)
{
string result = string.Empty;
DateTime dateTime=new DateTime(1970,1,1);
dateTime = dateTime.AddMilliseconds(long.Parse(match.Groups[1].Value));
dateTime = dateTime.ToLocalTime();
result = dateTime.ToString("yyyy-MM-dd HH:mm:ss");
return result;
}
private static string ConvertDateStringToJsonDate(Match m)
{
string result = string.Empty;
DateTime dt = DateTime.Parse(m.Groups[0].Value);
dt = dt.ToUniversalTime();
TimeSpan ts = dt - DateTime.Parse("1970-01-01");
result = string.Format("\\/Date({0}+0800)\\/",ts.TotalMilliseconds);
return result;
}
#endregion
// 對(duì)象轉(zhuǎn)換為Json
public static string ObjectToJson(object obj)
{
JavaScriptSerializer js=new JavaScriptSerializer();
try
{
return js.Serialize(obj);
}
catch (Exception exception)
{
throw new Exception(exception.Message);
}
}
// 數(shù)據(jù)表轉(zhuǎn)化為集合
public static List<Dictionary<string,object>> DataTableToList(DataTable dt)
{
List<Dictionary<string ,object>> list=new List<Dictionary<string, object>>();
foreach (DataRow dataRow in dt.Rows)
{
Dictionary<string,object> dic=new Dictionary<string, object>();
foreach (DataColumn dc in dt.Columns)
{
dic.Add(dc.ColumnName,dataRow[dc.ColumnName]);
}
list.Add(dic);
}
return list;
}
// 表轉(zhuǎn)換為Json
public static string DataTableToJson(DataTable dt)
{
return ObjectToJson(DataTableToList(dt));
}
}
public class JsonHelper
{
#region 序列化和反序列化
// 序列化
public static string JsonSerializer<T>(T t)
{
// 使用 DataContractJsonSerializer 將 T 對(duì)象序列化為內(nèi)存流。
DataContractJsonSerializer jsonSerializer = new DataContractJsonSerializer(typeof (T));
MemoryStream ms = new MemoryStream();
// 使用 WriteObject 方法將 JSON 數(shù)據(jù)寫(xiě)入到流中。
jsonSerializer.WriteObject(ms, t);
// 流轉(zhuǎn)字符串
string jsonString = Encoding.UTF8.GetString(ms.ToArray());
ms.Close();
//替換Json的Date字符串
string p = @"\\/Date\((\d+)\+\d+\)\\/";
MatchEvaluator matchEvaluator = new MatchEvaluator(ConvertJsonDateToDateString);
Regex reg = new Regex(p);
jsonString = reg.Replace(jsonString, matchEvaluator);
return jsonString;
}
public static T JsonDeserialize<T>(string jsonString)
{
//將"yyyy-MM-dd HH:mm:ss"格式的字符串轉(zhuǎn)為"\/Date(1294499956278+0800)\/"格式
string p = @"\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}";
MatchEvaluator matchEvaluator = new MatchEvaluator(ConvertDateStringToJsonDate);
Regex reg = new Regex(p);
jsonString = reg.Replace(jsonString, matchEvaluator);
DataContractJsonSerializer jsonSerializer=new DataContractJsonSerializer(typeof(T));
// 字符串轉(zhuǎn)流
MemoryStream ms=new MemoryStream(Encoding.UTF8.GetBytes(jsonString));
// 通過(guò)使用 DataContractJsonSerializer 的 ReadObject 方法,將 JSON 編碼數(shù)據(jù)反序列化為T(mén)
T obj = (T) jsonSerializer.ReadObject(ms);
return obj;
}
public static string ConvertJsonDateToDateString(Match match)
{
string result = string.Empty;
DateTime dateTime=new DateTime(1970,1,1);
dateTime = dateTime.AddMilliseconds(long.Parse(match.Groups[1].Value));
dateTime = dateTime.ToLocalTime();
result = dateTime.ToString("yyyy-MM-dd HH:mm:ss");
return result;
}
private static string ConvertDateStringToJsonDate(Match m)
{
string result = string.Empty;
DateTime dt = DateTime.Parse(m.Groups[0].Value);
dt = dt.ToUniversalTime();
TimeSpan ts = dt - DateTime.Parse("1970-01-01");
result = string.Format("\\/Date({0}+0800)\\/",ts.TotalMilliseconds);
return result;
}
#endregion
// 對(duì)象轉(zhuǎn)換為Json
public static string ObjectToJson(object obj)
{
JavaScriptSerializer js=new JavaScriptSerializer();
try
{
return js.Serialize(obj);
}
catch (Exception exception)
{
throw new Exception(exception.Message);
}
}
// 數(shù)據(jù)表轉(zhuǎn)化為集合
public static List<Dictionary<string,object>> DataTableToList(DataTable dt)
{
List<Dictionary<string ,object>> list=new List<Dictionary<string, object>>();
foreach (DataRow dataRow in dt.Rows)
{
Dictionary<string,object> dic=new Dictionary<string, object>();
foreach (DataColumn dc in dt.Columns)
{
dic.Add(dc.ColumnName,dataRow[dc.ColumnName]);
}
list.Add(dic);
}
return list;
}
// 表轉(zhuǎn)換為Json
public static string DataTableToJson(DataTable dt)
{
return ObjectToJson(DataTableToList(dt));
}
}
3. 添加ashx代碼文件
public class GetData : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
if (context.Request["action"]=="display")
{
context.Response.Write(JsonHelper.DataTableToJson(GetAllUsers()));
}
}
static SqlConnection conn = new SqlConnection("server=.;database=Test;uid=sa;pwd=123456");
public static DataTable GetAllUsers()
{
string sql = "select * from users";
SqlDataAdapter adapter = new SqlDataAdapter(sql, conn);
DataTable dt = new DataTable();
adapter.Fill(dt);
return dt;
}
public bool IsReusable
{
get
{
return false;
}
}
}
public class GetData : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
if (context.Request["action"]=="display")
{
context.Response.Write(JsonHelper.DataTableToJson(GetAllUsers()));
}
}
static SqlConnection conn = new SqlConnection("server=.;database=Test;uid=sa;pwd=123456");
public static DataTable GetAllUsers()
{
string sql = "select * from users";
SqlDataAdapter adapter = new SqlDataAdapter(sql, conn);
DataTable dt = new DataTable();
adapter.Fill(dt);
return dt;
}
public bool IsReusable
{
get
{
return false;
}
}
}
4. 前端調(diào)用
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
<script src="js/jquery-1.6.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
var options = {
type: 'post',
url: "/GetData.ashx",
dataType: "json",
data: { action: "display" },
success: function(data) {
var html = "<table border='2px' style='text-align:center;border-style:solid;border-width:2px;border-color:#00ff00;'><tr><td>UserId</td><td>UserName</td></tr>";
$.each(data, function(i, result) {
html += "<tr><td>" + result["UserId"] + "</td><td>" + result["UserName"] + "</td></tr>";
})
html += "</table>";
$("#divData").html(html);
}
};
$.ajax(options);
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div id="divData">
</div>
</form>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
<script src="js/jquery-1.6.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
var options = {
type: 'post',
url: "/GetData.ashx",
dataType: "json",
data: { action: "display" },
success: function(data) {
var html = "<table border='2px' style='text-align:center;border-style:solid;border-width:2px;border-color:#00ff00;'><tr><td>UserId</td><td>UserName</td></tr>";
$.each(data, function(i, result) {
html += "<tr><td>" + result["UserId"] + "</td><td>" + result["UserName"] + "</td></tr>";
})
html += "</table>";
$("#divData").html(html);
}
};
$.ajax(options);
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div id="divData">
</div>
</form>
</body>
</html>
5. 效果圖
6. 同樣可以通過(guò)getJSON方法讀取數(shù)據(jù)
$.getJSON("/GetData.ashx",{ action: "display" },function(data) {
var html = "<table border='2px' style='text-align:center;border-style:solid;border-width:2px;border-color:#00ff00;'><tr><td>UserId</td><td>UserName</td></tr>";
$.each(data, function(i, result) {
html += "<tr><td>" + result["UserId"] + "</td><td>" + result["UserName"] + "</td></tr>";
})
html += "</table>";
$("#divData").html(html);
})
$.getJSON("/GetData.ashx",{ action: "display" },function(data) {
var html = "<table border='2px' style='text-align:center;border-style:solid;border-width:2px;border-color:#00ff00;'><tr><td>UserId</td><td>UserName</td></tr>";
$.each(data, function(i, result) {
html += "<tr><td>" + result["UserId"] + "</td><td>" + result["UserName"] + "</td></tr>";
})
html += "</table>";
$("#divData").html(html);
})
復(fù)制代碼 代碼如下:
create table Users
(
UserId int identity(1,1) primary key,
UserName varchar(20)
)
insert into Users values('Bradley')
insert into Users values('Dan')
復(fù)制代碼 代碼如下:
create table Users
(
UserId int identity(1,1) primary key,
UserName varchar(20)
)
insert into Users values('Bradley')
insert into Users values('Dan')
2. 創(chuàng)建JsonHelper類(lèi)
復(fù)制代碼 代碼如下:
public class JsonHelper
{
#region 序列化和反序列化
// 序列化
public static string JsonSerializer<T>(T t)
{
// 使用 DataContractJsonSerializer 將 T 對(duì)象序列化為內(nèi)存流。
DataContractJsonSerializer jsonSerializer = new DataContractJsonSerializer(typeof (T));
MemoryStream ms = new MemoryStream();
// 使用 WriteObject 方法將 JSON 數(shù)據(jù)寫(xiě)入到流中。
jsonSerializer.WriteObject(ms, t);
// 流轉(zhuǎn)字符串
string jsonString = Encoding.UTF8.GetString(ms.ToArray());
ms.Close();
//替換Json的Date字符串
string p = @"\\/Date\((\d+)\+\d+\)\\/";
MatchEvaluator matchEvaluator = new MatchEvaluator(ConvertJsonDateToDateString);
Regex reg = new Regex(p);
jsonString = reg.Replace(jsonString, matchEvaluator);
return jsonString;
}
public static T JsonDeserialize<T>(string jsonString)
{
//將"yyyy-MM-dd HH:mm:ss"格式的字符串轉(zhuǎn)為"\/Date(1294499956278+0800)\/"格式
string p = @"\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}";
MatchEvaluator matchEvaluator = new MatchEvaluator(ConvertDateStringToJsonDate);
Regex reg = new Regex(p);
jsonString = reg.Replace(jsonString, matchEvaluator);
DataContractJsonSerializer jsonSerializer=new DataContractJsonSerializer(typeof(T));
// 字符串轉(zhuǎn)流
MemoryStream ms=new MemoryStream(Encoding.UTF8.GetBytes(jsonString));
// 通過(guò)使用 DataContractJsonSerializer 的 ReadObject 方法,將 JSON 編碼數(shù)據(jù)反序列化為T(mén)
T obj = (T) jsonSerializer.ReadObject(ms);
return obj;
}
public static string ConvertJsonDateToDateString(Match match)
{
string result = string.Empty;
DateTime dateTime=new DateTime(1970,1,1);
dateTime = dateTime.AddMilliseconds(long.Parse(match.Groups[1].Value));
dateTime = dateTime.ToLocalTime();
result = dateTime.ToString("yyyy-MM-dd HH:mm:ss");
return result;
}
private static string ConvertDateStringToJsonDate(Match m)
{
string result = string.Empty;
DateTime dt = DateTime.Parse(m.Groups[0].Value);
dt = dt.ToUniversalTime();
TimeSpan ts = dt - DateTime.Parse("1970-01-01");
result = string.Format("\\/Date({0}+0800)\\/",ts.TotalMilliseconds);
return result;
}
#endregion
// 對(duì)象轉(zhuǎn)換為Json
public static string ObjectToJson(object obj)
{
JavaScriptSerializer js=new JavaScriptSerializer();
try
{
return js.Serialize(obj);
}
catch (Exception exception)
{
throw new Exception(exception.Message);
}
}
// 數(shù)據(jù)表轉(zhuǎn)化為集合
public static List<Dictionary<string,object>> DataTableToList(DataTable dt)
{
List<Dictionary<string ,object>> list=new List<Dictionary<string, object>>();
foreach (DataRow dataRow in dt.Rows)
{
Dictionary<string,object> dic=new Dictionary<string, object>();
foreach (DataColumn dc in dt.Columns)
{
dic.Add(dc.ColumnName,dataRow[dc.ColumnName]);
}
list.Add(dic);
}
return list;
}
// 表轉(zhuǎn)換為Json
public static string DataTableToJson(DataTable dt)
{
return ObjectToJson(DataTableToList(dt));
}
}
復(fù)制代碼 代碼如下:
public class JsonHelper
{
#region 序列化和反序列化
// 序列化
public static string JsonSerializer<T>(T t)
{
// 使用 DataContractJsonSerializer 將 T 對(duì)象序列化為內(nèi)存流。
DataContractJsonSerializer jsonSerializer = new DataContractJsonSerializer(typeof (T));
MemoryStream ms = new MemoryStream();
// 使用 WriteObject 方法將 JSON 數(shù)據(jù)寫(xiě)入到流中。
jsonSerializer.WriteObject(ms, t);
// 流轉(zhuǎn)字符串
string jsonString = Encoding.UTF8.GetString(ms.ToArray());
ms.Close();
//替換Json的Date字符串
string p = @"\\/Date\((\d+)\+\d+\)\\/";
MatchEvaluator matchEvaluator = new MatchEvaluator(ConvertJsonDateToDateString);
Regex reg = new Regex(p);
jsonString = reg.Replace(jsonString, matchEvaluator);
return jsonString;
}
public static T JsonDeserialize<T>(string jsonString)
{
//將"yyyy-MM-dd HH:mm:ss"格式的字符串轉(zhuǎn)為"\/Date(1294499956278+0800)\/"格式
string p = @"\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}";
MatchEvaluator matchEvaluator = new MatchEvaluator(ConvertDateStringToJsonDate);
Regex reg = new Regex(p);
jsonString = reg.Replace(jsonString, matchEvaluator);
DataContractJsonSerializer jsonSerializer=new DataContractJsonSerializer(typeof(T));
// 字符串轉(zhuǎn)流
MemoryStream ms=new MemoryStream(Encoding.UTF8.GetBytes(jsonString));
// 通過(guò)使用 DataContractJsonSerializer 的 ReadObject 方法,將 JSON 編碼數(shù)據(jù)反序列化為T(mén)
T obj = (T) jsonSerializer.ReadObject(ms);
return obj;
}
public static string ConvertJsonDateToDateString(Match match)
{
string result = string.Empty;
DateTime dateTime=new DateTime(1970,1,1);
dateTime = dateTime.AddMilliseconds(long.Parse(match.Groups[1].Value));
dateTime = dateTime.ToLocalTime();
result = dateTime.ToString("yyyy-MM-dd HH:mm:ss");
return result;
}
private static string ConvertDateStringToJsonDate(Match m)
{
string result = string.Empty;
DateTime dt = DateTime.Parse(m.Groups[0].Value);
dt = dt.ToUniversalTime();
TimeSpan ts = dt - DateTime.Parse("1970-01-01");
result = string.Format("\\/Date({0}+0800)\\/",ts.TotalMilliseconds);
return result;
}
#endregion
// 對(duì)象轉(zhuǎn)換為Json
public static string ObjectToJson(object obj)
{
JavaScriptSerializer js=new JavaScriptSerializer();
try
{
return js.Serialize(obj);
}
catch (Exception exception)
{
throw new Exception(exception.Message);
}
}
// 數(shù)據(jù)表轉(zhuǎn)化為集合
public static List<Dictionary<string,object>> DataTableToList(DataTable dt)
{
List<Dictionary<string ,object>> list=new List<Dictionary<string, object>>();
foreach (DataRow dataRow in dt.Rows)
{
Dictionary<string,object> dic=new Dictionary<string, object>();
foreach (DataColumn dc in dt.Columns)
{
dic.Add(dc.ColumnName,dataRow[dc.ColumnName]);
}
list.Add(dic);
}
return list;
}
// 表轉(zhuǎn)換為Json
public static string DataTableToJson(DataTable dt)
{
return ObjectToJson(DataTableToList(dt));
}
}
3. 添加ashx代碼文件
復(fù)制代碼 代碼如下:
public class GetData : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
if (context.Request["action"]=="display")
{
context.Response.Write(JsonHelper.DataTableToJson(GetAllUsers()));
}
}
static SqlConnection conn = new SqlConnection("server=.;database=Test;uid=sa;pwd=123456");
public static DataTable GetAllUsers()
{
string sql = "select * from users";
SqlDataAdapter adapter = new SqlDataAdapter(sql, conn);
DataTable dt = new DataTable();
adapter.Fill(dt);
return dt;
}
public bool IsReusable
{
get
{
return false;
}
}
}
復(fù)制代碼 代碼如下:
public class GetData : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
if (context.Request["action"]=="display")
{
context.Response.Write(JsonHelper.DataTableToJson(GetAllUsers()));
}
}
static SqlConnection conn = new SqlConnection("server=.;database=Test;uid=sa;pwd=123456");
public static DataTable GetAllUsers()
{
string sql = "select * from users";
SqlDataAdapter adapter = new SqlDataAdapter(sql, conn);
DataTable dt = new DataTable();
adapter.Fill(dt);
return dt;
}
public bool IsReusable
{
get
{
return false;
}
}
}
4. 前端調(diào)用
復(fù)制代碼 代碼如下:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
<script src="js/jquery-1.6.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
var options = {
type: 'post',
url: "/GetData.ashx",
dataType: "json",
data: { action: "display" },
success: function(data) {
var html = "<table border='2px' style='text-align:center;border-style:solid;border-width:2px;border-color:#00ff00;'><tr><td>UserId</td><td>UserName</td></tr>";
$.each(data, function(i, result) {
html += "<tr><td>" + result["UserId"] + "</td><td>" + result["UserName"] + "</td></tr>";
})
html += "</table>";
$("#divData").html(html);
}
};
$.ajax(options);
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div id="divData">
</div>
</form>
</body>
</html>
復(fù)制代碼 代碼如下:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
<script src="js/jquery-1.6.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
var options = {
type: 'post',
url: "/GetData.ashx",
dataType: "json",
data: { action: "display" },
success: function(data) {
var html = "<table border='2px' style='text-align:center;border-style:solid;border-width:2px;border-color:#00ff00;'><tr><td>UserId</td><td>UserName</td></tr>";
$.each(data, function(i, result) {
html += "<tr><td>" + result["UserId"] + "</td><td>" + result["UserName"] + "</td></tr>";
})
html += "</table>";
$("#divData").html(html);
}
};
$.ajax(options);
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div id="divData">
</div>
</form>
</body>
</html>
5. 效果圖
6. 同樣可以通過(guò)getJSON方法讀取數(shù)據(jù)
復(fù)制代碼 代碼如下:
$.getJSON("/GetData.ashx",{ action: "display" },function(data) {
var html = "<table border='2px' style='text-align:center;border-style:solid;border-width:2px;border-color:#00ff00;'><tr><td>UserId</td><td>UserName</td></tr>";
$.each(data, function(i, result) {
html += "<tr><td>" + result["UserId"] + "</td><td>" + result["UserName"] + "</td></tr>";
})
html += "</table>";
$("#divData").html(html);
})
復(fù)制代碼 代碼如下:
$.getJSON("/GetData.ashx",{ action: "display" },function(data) {
var html = "<table border='2px' style='text-align:center;border-style:solid;border-width:2px;border-color:#00ff00;'><tr><td>UserId</td><td>UserName</td></tr>";
$.each(data, function(i, result) {
html += "<tr><td>" + result["UserId"] + "</td><td>" + result["UserName"] + "</td></tr>";
})
html += "</table>";
$("#divData").html(html);
})
您可能感興趣的文章:
- jQuery+json實(shí)現(xiàn)動(dòng)態(tài)創(chuàng)建復(fù)雜表格table的方法
- JQuery實(shí)現(xiàn)table行折疊效果以JSON做數(shù)據(jù)源
- jQuery通過(guò)ajax請(qǐng)求php遍歷json數(shù)組到table中的代碼(推薦)
- js實(shí)現(xiàn)將json數(shù)組顯示前臺(tái)table中
- js中將字符串轉(zhuǎn)換成json的三種方式
- 解析JSON對(duì)象與字符串之間的相互轉(zhuǎn)換
- JS對(duì)象與JSON格式數(shù)據(jù)相互轉(zhuǎn)換
- JQuery遍歷json數(shù)組的3種方法
- 使用jsonp完美解決跨域問(wèn)題
- jQuery中讀取json文件示例代碼
- js與jQuery實(shí)現(xiàn)獲取table中的數(shù)據(jù)并拼成json字符串操作示例
相關(guān)文章
jQuery EasyUI 右鍵菜單--關(guān)閉標(biāo)簽/選項(xiàng)卡的簡(jiǎn)單實(shí)例
下面小編就為大家?guī)?lái)一篇jQuery EasyUI 右鍵菜單--關(guān)閉標(biāo)簽/選項(xiàng)卡的簡(jiǎn)單實(shí)例。小編覺(jué)得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2016-10-10
jQuery slider Content(左右控制移動(dòng))
jQuery slider Content(左右控制移動(dòng))實(shí)現(xiàn)代碼,大家可以參考下。2009-09-09
Jquery實(shí)現(xiàn)帶動(dòng)畫(huà)效果的經(jīng)典二級(jí)導(dǎo)航菜單
導(dǎo)航菜單在網(wǎng)頁(yè)中呈現(xiàn)的頻率還是比較多的,因?yàn)樾Ч喈?dāng)不錯(cuò),接下來(lái)為大家介紹下使用jquery實(shí)現(xiàn)經(jīng)典二級(jí)導(dǎo)航菜單,各位童鞋們快來(lái)圍觀哦2013-03-03
Jquery如何實(shí)現(xiàn)點(diǎn)擊時(shí)高亮顯示代碼
點(diǎn)擊時(shí)高亮顯示代碼的實(shí)現(xiàn)方法有很多,下面的示例使用jquery來(lái)實(shí)現(xiàn),需要的朋友可以了解下2014-01-01
AspNet中使用JQuery上傳插件Uploadify詳解
Uploadify是JQuery的一個(gè)上傳插件,實(shí)現(xiàn)的效果非常不錯(cuò),帶進(jìn)度顯示。不過(guò)官方提供的實(shí)例時(shí)php版本的,本文將詳細(xì)介紹Uploadify在Aspnet中的使用2015-05-05
jQuery插件ajaxfileupload.js實(shí)現(xiàn)上傳文件
這篇文章主要為大家詳細(xì)介紹了jQuery插件ajaxfileupload.js實(shí)現(xiàn)上傳文件的相關(guān)資料,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2016-05-05
jquery 提示信息顯示后自動(dòng)消失的具體實(shí)現(xiàn)
讓提示信息顯示后自動(dòng)消失的方法有很多,在本文為大家介紹下使用jquery是如何做到的,感興趣朋友可以參考下2013-12-12

