JS to cross the domain, you can use:
<script src= "Other site's JS address (here can be dynamically generated, such as: aaa.jsp, bbb.aspx) can be. "></script> is able to read data from other sites," he said.
The key is to see your spirit is not flexible, will not use.
Ajax to cross domain, you can use the server to other sites to take content, such as asp.net:
Copy Code code as follows:
public string geturldata (string url)
{
System.Net.HttpWebRequest webRequest = (System.Net.HttpWebRequest) System.Net.WebRequest.Create (URL);
System.Net.WebResponse WebResponse = Webrequest.getresponse ();
System.IO.Stream IStream = WebResponse.GetResponseStream ();
System.IO.StreamReader sr = new System.IO.StreamReader (IStream, System.Text.Encoding.Default);
String str = Sr. ReadToEnd ();
Sr. Close ();
Istream.close ();
WebResponse.Close ();
return str;
}
This method has already been written, you can get the Ajax return value you want as long as you pass in the URL address of the website.
This will be another site's Ajax request, write to their own server, and then you use AJAX to request your own written the
The ASPX address is OK.
If it's Java, it's the same thing, like:
Copy Code code as follows:
URL url = new URL ("http://www.jb51.net/index.html");
FilterInputStream f= (FilterInputStream) Url.openstream ();
Of course, the principle of asp,php is the same, that is, the use of the thief function to achieve access to content.