前台我这样写的,当页面加载的时候就执行异步请求
$(function () {
$.ajax({
type: 'POST',
url: '/ArticleController/GetJSON',
dataType: "json",
success: function (data) {
alert(data);
}
});
});后台 在Article控制器里面的方法 public ActionResult GetJSON()
{
return this.Json(new Catalog().GetPathItems());//一个集合
}这里没反应,没执行到alter,求解释
$(function () {
$.ajax({
type: 'POST',
url: '/ArticleController/GetJSON',
dataType: "json",
success: function (data) {
alert(data);
}
});
});后台 在Article控制器里面的方法 public ActionResult GetJSON()
{
return this.Json(new Catalog().GetPathItems());//一个集合
}这里没反应,没执行到alter,求解释
$.ajax({
type: 'POST',
url: '/Article/GetJSON',
dataType: "json",
success: function (data) {
alert(data);
}
});
});