As long as this article introduces jquery ajax cross-origin solution (json mode), you can refer to it for help.
Cross-origin ajax requests are required in many projects recently developed by the company, for example, http: //. ****. com/index123.aspx, http: // B. ****. com/index2.aspx requests the json information of the user and then processes the data. At first, my colleagues and I tried many methods, using $. ajax (), whether it is get or post, will cause uri deny errors. Some GG later found the solution and understood the reasons. Since jquery 1.2,. getJSON supports cross-origin operations. The jquery. getJSON () method can be used to solve cross-origin problems. Example: <script type = "text/javascript" src = "/script/jquery. js "> </script> function gettst2 () {$. getJSON ("http://ucenter.xxxx.com.cn/ajax/test.aspx? Callback =? ", {Id:" 123456 ", site:" 01 "}, function (data) {alert(data.html s); document. getElementById ("shows "). innerHTML = data.html s;}) ;}gettst2 (); ASPX. the cs file is processed as string jsoncall = Request. queryString ("callback"); Response. write (jsoncall + "({htmls: Test 001})"); If html code is added, do not add the/n symbol. Otherwise, garbled characters and js errors may occur.