The solution does not advocate cross-origin post requests. 0. cross-origin scheme jsonp of ajax in jquery. ashx code using System; using System. collections. generic; using System. linq; using System. web; namespace KB. DSN. web. API. tokens {/// <summary> /// Summary description for Get /// </summary> public class Get: IHttpHandler {public void ProcessRequest (HttpContext context) {setresponsecontext (context); var token = KB. DSN. businessAccess. uniqueCommunicationCode. generateUniqueCommunicationCode (); var outputobject = new {Head = new Models. KBJsonHeadResponse (), Body = new {Token = token}; var outputjsonstring = Newtonsoft. json. jsonConvert. serializeObject (outputobject); context. response. write (context. request. queryString ["callback"] + "(" + outputjsonstring + ")");} private void setresponsecontext (HttpContext context) {context. response. contentEncoding = System. text. encoding. UTF8; context. response. contentType = "application/json";} public bool IsReusable {get {return false ;}}} html page function getToken_jsonp () {$. ajax ({url :" http://192.168.0.111/api/tokens/get.ashx ", Type:" get ", dataType:" jsonp ", jsonp:" callback ", async: false, contentType:" application/json ", success: function (data) {// alert ("getToken success"); $ ("# token "). text ($. toJSON (data); // console. log (data) ;}, error: function () {alert ("getToken fail") ;}}) ;}jsonp only supports GET requests and does not support POST requests, even if you write a POST, it will automatically convert it to a GET request and put your data in querystring. 1. Modify the web. config file. The entire application supports cross-origin requests. Web. config <system. webServer>