In this article, as long as the jquery Ajax Cross-domain Solution (JSON method) is introduced, the need for friends can come to the reference, I hope to help you
Recently, many of the projects developed by the company require Cross-domain AJAX requests, such as http://a.****.com/index123.aspx under several subdomains, http://b.****.com/index2.aspx requesting user JSON information, And then processing the data, at first I and my colleagues tried a number of ways, using $.ajax () either a Get or post method will cause the URI deny error. GG After found the solution, but also understand the reasons. jquery starts with 1.2, and the. Getjson supports Cross-domain operations. Use the Jquery.getjson () method to resolve cross-domain problems. Examples are the following foreground <script type= "Text/javascript" src= "/script/jquery.js" ></script> HTML JS code function gettst2 () { $.getjson ("http://ucenter.xxxx.com.cn/ajax/test.aspx?callback=?", {ID: "123456", Site: "}", function (data) {Ale RT (DATA.HTMLS); document.getElementById ("shows"). InnerHTML = data.htmls; }); } gettst2 (); The ASPX.cs file is processed as String jsoncall = Request.QueryString ("callback"); Response.Write (Jsoncall + "({htmls: Test 001})"); If add HTML code, do not add/n symbol, otherwise will appear garbled, JS error.