The simple principle of cross-domain: The general browser will prevent JS Request Heresy server (a server request B server). JS connection except for: <script type= "Text/jscript" src= "Http://www.yourtour.cc/ajax_test.js" ></script> iframe, CSS , script can make heresy request data.
Local HTML
<! DOCTYPE HTML Public"-//W3C//DTD XHTML 1.0 transitional//en" "HTTP://WWW.W3.ORG/TR/XHTML1/DTD/XHTML1-TRANSITIONAL.DTD">"http://www.w3.org/1999/xhtml">"Content-type"Content="text/html; Charset=utf-8"/><title> Untitled Document </title><script type="Text/jscript"Src="Jquery-1.11.2.min.js"></script><script type="Text/jscript"Src="Http://www.yourtour.cc/ajax_test.js"></script>"Con"style="height:300px; width:300px; margin:0 auto; background: #09F"></div><input name="1111"Type="Button"Value="Request Ajax"onclick="Ajax ()"/></body>Needs to be placed on the server
JS file
function Ajax () { $.ajax ({ URL:'t.html', success: function (HTML) { alert (HTML);}} ) }
Page to request (php,html)
Congratulations, request. Cross-Domain Ajax data
Ajax successfully wrote itself across the domain _