- $.ajax({
- type: "GET",
- url: "/home/getdev",
- data: "{}",
- contentType: "application/json; charset=utf-8",
- dataType: "json",
- success: function(msg) {
- // Do something interesting here.
- console.log(msg);
- }
- });//ajax ends here
- public JsonResult GetDev()
- {
- return Json(new {author = "najam sikander awan", email="najamsk@gmail.com"},JsonRequestBehavior.AllowGet);
- }
- //该片段来自于http://www.codesnippet.cn/detail/0911201513952.html
来源: http://www.codesnippet.cn/detail/0911201513952.html