html(../Home/Index.cshtml)
<body> <button class="Btn">按钮</button> </body>
js
$(document).ready(function () { $(".Btn").click(function () { $.getJSON("../Home/Index",function (data) { for (var i = 0 ; i < data.length; i++) { var obj = data[i]; alert(obj); } }); });
HomeController
public ActionResult Index(string url) { ArrayList list = new ArrayList() {"1","2","3" }; return Json(list,JsonRequestBehavior.AllowGet); ; }