*.json 与 *.asp的内容是一样的,均是按uft-8编码保存,就是扩展名不一样,
IIS7.5 环境下,已添加 .json 的 MIME
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" type="text/css"
href="easyui/themes/icon.css">
<link rel="stylesheet" type="text/css"
href="easyui/themes/default/easyui.css">
<script type="text/javascript"
src="easyui/jquery.min.js"></script>
<script type="text/javascript"
src="easyui/jquery.easyui.min.js"></script>
<script type="text/javascript">
$(function() {
var url='feedback_data.json';
$('#feedback').datagrid({
title : "用户反馈 - 所有",
width : "auto",
striped : true,
singleSelect : true,
loadMsg : "正在加载,请稍等...",
url : url,
pagination : true,
rownumbers : true,
pageList : [ 5, 10, 15, 20 ],
pageSize : 10,
idField:"id",
columns:[[
{title:"发送人",field:"user",width:"180",align:"center"} ,
{title:"反馈内容",field:"title",width:"300",align:"center"},
{title:"时间",field:"sendTime",width:"300",align:"center"}
]],
onDblClickRow:function(index,row){
alert(row.id);
}
});
});
</script>
</head>
<body>
<h1>HELLO</h1>
<table id="feedback" sytle="width:640px;height:400px;"></table>
</body>
</html>
如上无数据显示,把 url 换成 feedback_data.asp 就好了