asp.net jquery ajax 跨域调用

js:
        jQuery(document).ready(function(){
                $.ajax({
                    type : 
"GET",
                    url : 
"http://service.test.com/t1.ashx?callback=?",
                    dataType : 
"jsonp",
                   jsonp: 
"callback",
                    success : 
function(json){
                        $(
'#feeds').html(json.msg);
                        
return true;
                    }
                });
            });

    <div id="feeds">   </div>

t1.ashx
1         public void ProcessRequest(HttpContext context)
2         {
3             context.Response.ContentType = "text/html";
4             string callback = context.Request.Params["callback"];
5             context.Response.Write(callback + "({\"msg\":\"jquery test message!\"})");
6         }
原文地址:https://www.cnblogs.com/myx/p/1554978.html