In JQuery, the AJAX Methods getJSON and get that can be accessed across domains are described in the following example: AjaxURL path: http://www.a.com/api.aspxserver interface file api.aspx.cs restart ------------------------------------------------------------------
JQuery AJAX methods that can be accessed across domains
GetJSON, get
See the sample code first.
Ajax URL path: http://www.A.com/Api.aspx
Api. Aspx. cs
Bytes -----------------------------------------------------------------------------------------------------------------------------
Protected void Page_Load (object sender, EventArgs e)
{
String jsoncallback = Request. QueryString ["jsoncallback"];
Response. ContentEncoding = Encoding. UTF8;
Response. ContentType = "application/json ";
Response. Write (jsoncallback + "({\" UserID \ ": \" 123456789 \ ", \" UserName \ ": \" admin \"})");/
Response. End ();
}
Client call page