In ie, the message shown is displayed every time RSS is read. In Firefox, RSS is not read at all.
{
Img_auto_size (this, 450, true );
} "Align =" baseline "twffan =" done "src =" http://esoft.bokee.com/inc/AJAXProxy1.jpg ">
This is because AJAX can only access resources in the current domain, rather than cross-origin access, based on security considerations. That is to say, Ajax in the domain1.com site can only access resources under the domain1.com site, but cannot access resources in the domain2.com site across domains. This is the cross-origin issue of Ajax.
There are several methods to solve Ajax cross-origin problems. Here we only discuss one of the most common methods-use Ajax proxy to solve Ajax cross-origin problems. that is, dynamic web pages (Asp, PHP, JSP, etc.) are used as proxy pages in the domain1.com site to read Resources in the domain2.com site, and then the agent pages in the domain1.com site are read using Ajax. take ASP as an example to introduce Ajax Proxy:
Ajax proxy --- ASP (JavaScript)
Ajaxproxy. asp
- <% @ Language = "JavaScript" codePage = "936" %>
- <%
- VaR http1 = server. Createobject ("Microsoft. XMLHTTP ");
- VaR rss_url = request ("rss_url ");
- Http1.open ("get", rss_url, false );
- Response. contenttype = "text/XML ";
- Http1.send (null );
- If (http1.readystate = 4 ){
- Response. binarywrite (http1.responsebody );
- }
- Http1 = NULL;
- %>
Ajax proxy --- ASP (VBScript)
Ajaxproxy. asp
- <% @ Language = "VBScript" codePage = "936" %>
- <%
- Function send_request (URL)
- Set retrieval = Createobject ("Microsoft. XMLHTTP ")
- With Retrieval
- . Open "get", URL, false ,"",""
- . Send
- Send_request =. responsebody
- End
- Response. contenttype = "text/XML"
- Set retrieval = nothing
- End Function
- Url = request ("rss_url ")
- Response. binarywrite send_request (URL)
- Response. Flush
- %>
Http://developer.yahoo.com/javascript/howto-proxy.html