Expanded function demand, recently received a new requirement in the referenced data interface but can only provide the XML format … … But no thought of JS aspects of their own ability is limited, the ideal solution, so we have to seek the AS the engineer's help, after nearly two days of alignment, the final solution of the browsing the cross-domain access.
record demo code below:
the parent page HTML:

code is as follows:


<HiddenIframe iframe id="" style=" width: 0 px; height: 0 px0; border: 0 px; none * width: 1 px; * height: 0 px; overflow: hidden;" ></iframe>
<Retrieve data button value="http://www.jb51.net//web/" ></button>
<! - why not directly display: none; Or visibility: hidden; ? - later explanation: tag 】 【 >

the parent page JS:

code is as follows:


the document. The domain="xxx.com";
function getData (data) {
the if (data="" http://www.jb51.net//web/=| | undefined data=http://www.jb51.net//web/=| | data==null) {
sendData publishes the event (" a=1 & b=2");//format any parameters, the parameters of the equivalent to you when a get request

} else {
alert (" access to data: "+ data)
}}
the function sendData publishes the event (param) {
var childWindow=document. The getElementById (' testIframe '). The contentWindow; .
childWindow sendData publishes the event (param);//driver, driver hidden within the domain of method gets the XML API to invoke AS

} function change () {
the document. The getElementById (" testIframe "). The SRC="http://www.jb51.net//web/xx.html";//hide the domain URL
}

child pages JS:

code is as follows:


the document. The domain="xxx.com";
the function sendData publishes the event (paramFromParent) {
var severUrl='xxx.com';
//here to deal with paramFromParent for the complete bearing XXX. XML URL
//and then call the AS the URLLoader method to obtain the data under the URL
//success after calling the following methods to drive the getData method in the parent page of

} function getData (backData) {
window. The parent. The getData (backData);
}

tags: not display or visibility because: under the Internet explorer browser, when you're an iframe element to set the style for this two points, within the framework of the JS not to load, also can't communicate...
easy to understand, the above talk


This concludes the body part