日期:2014-05-16 浏览次数:20347 次
$(document).ready(function () {
$.ajax({
type: 'POST',
dataType: 'text',
async: false,
cache: false,
url: '/AdminLogin/NewsAddHandler.ashx?op=PageStartLoading&todo=LoadingList',
// data:{ op:'PageStartLoading',todo:'LoadingList'},
success: function (data) {
var json = standardJson(data);
$("#table1").BindData(json);
},
error: function (XMLHttpRequest, textStatus) {
alert("异常:" + XMLHttpRequest.reponseText + ";Status:" + textStatus);
}
});
});
function standardJson(data){
var obj = eval("(" + data + ")");
// var jsonobj = JSON.parse(data);
// alert(jsonobj.Table);
var string = "[";
for (var i = 0; i < obj.Table.length; i++) {
string += "{";
var j = 0;
for (var key in obj.Table[i]) {
//alert("key:" + key + ",value:" + obj.Table[i][key]);
var k = j + 1;
string += "Data" + k + ":\"" + obj.Table[i][key] + "\"";
if (j == 8) {
string += "},";
continue;
}
j++;
string += ",";
}
}
string += "-,";
string = string.replace(/,-,/g, "]");
var json = eval("(" + string + ")");
return json;
}
$("a").bind("click", function () {
al