If Javascript is to be cross-origin, you can use:
<Script src = "js addresses of other websites (the inner space can be dynamically generated, such as aaa. jsp and bbb. aspx. "> </Script> you can read data from other websites.
The key is to see if your spirit is not flexible and you will use it.
To cross-origin ajax, you can use the server to retrieve content from other websites, such as asp.net:
Copy codeThe Code is 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 been written. You only need to input the url of the website to obtain the ajax return value.
In this way, the ajax requests of other websites are written to your own server, and then you can use ajax to request the one you wrote.
The aspx address is enough.
The same applies to java, for example:
Copy codeThe Code is as follows:
URL url = new URL ("http://www.jb51.net ");
FilterInputStream f = (FilterInputStream) url. openStream ();