脚本跨域跨域

客户端:
 
   $.ajax({
            url: "http://localhost:13073/home/index",
            data: { name: "123" },
            method: "get",
            async:false,
            dataType: "jsonp",
            jsonp: "callback",
            jsonpCallback:"filght",
            success: function (data) {
                alert(data);
            }
        });

服务端:

public ActionResult Index()
        {
            string name = Request["name"].ToString();
            string callback = Request["callback"].ToString();

            return Content(callback+"("+name+")");
           
        }

 

你可能感兴趣的:(脚本跨域跨域)