非常感谢大家为我解答!可惜我想要的answer不是这样的
web services
跨域的解决方案
http://blog.csdn.net/alex_xhui/article/details/7030379
jsonp
ajax方式 var urlOne = "http://localhost:1951/otherOne.ashx"; $.ajax({ type: "get", url: urlOne, dataType: "jsonp", jsonp: "jsoncallback", beforeSend: function (data, http) { $("#divUrl").text(http.url); }, success: function (data) { alert(data.name); } }); 后台处理: public void ProcessRequest (HttpContext context) { context.Response.ContentType = "text/plain"; string callbackname = context.Request["jsoncallback"]; context.Response.Write(callbackname+"({name:'zhangsan'})"); context.Response.End(); }
web services,wcf
web services ,SOAP,wcf
具有src的标签 js格式数据