jquery ajax 传值
function fnGetPageList(index) {
var str = "";
$.ajax({
type: "POST",
url: "ashxFiles/roleInfo.ashx", //.net ashx文件地址
dataType: "json", //常用接收数据类型为text和josn
data: "pageIndex=" + index, //传参时,避免参数中出现\等特殊字符
async: false,
success: function(data) {
//使用返回的json数据构造表格[{r_id:\"" + r.r_id + "\",r_name:\"" + r.r_name + "\",r_createTime:\"" + r.r_createTime + "\",r_bz:\"" + r.r_bz + "\"}]
$.each(data, function(index, result) {
str = str + "<tr><td><input type='checkbox' /></td><td class='style1'>" + result["r_name"] + "</td><td><a href='#' title='权限修改'>权限修改</a></td><td>" + result["r_bz"] + "</td><td>" + result["r_createTime"] + "</td><td><a href='#' title='添加'><img src='resources/images/icons/pencil.png' alt='添加' /></a><a href='#' title='删除'><img src='resources/images/icons/cross.png' alt='删除' /></a> <a href='#' title='修改'><img src='resources/images/icons/hammer_screwdriver.png' alt='修改' /></a></td></tr>";
})
}
});
$("#strpageList").attr("value", str);
}
type:get //只可以传200多个字符
POST //没有限制