IFRAME: the cross-origin call height and width are adaptive. The following solution is simple. You can understand it by following the steps.
1. content to be added to the called page (called page url: http: // siteb/B. aspx ).
1.1 add <IFRAME id = "proxyiframe" Height = "0" width = "0" style = "display: none"/>
1.2 increase
$ (Function (){
VaR width = document.doc umentelement. clientwidth;
VaR Height = Document. Body. scrollheight;
If ($. browser. Mozilla)
{
Height = document.doc umentelement. scrollheight;
}
$ ("# Proxyiframe"). ATTR ("src", "http: // sitea/proxy.html #" + width + "|" + height );
})
2. content to be added to the call page (site of the call page: http: // sitea)
2.1 Add proxy.html to the website on the page to be called,
The script content is as follows (no other content, URL: http: // sitea/proxy.html ):
<SCRIPT type = "text/JavaScript">
VaR B _iframe = parent.parent.doc ument. getelementbyid ("iframe1 ");
VaR hash_url = Window. Location. Hash;
VaR hash_height = hash_url.split ("#") [1]. Split ("|") [1] + "PX ";
B _iframe.style.height = hash_height;
</SCRIPT>
2.2 add content to the call page:
<IFRAME id = "iframe1" src = "http: // siteb/B. aspx "Height =" 850 "width =" 930 "scrolling =" no "frameborder =" 0 "marginwidth =" 0 "marginheight =" 0 "/>
Complete the preceding steps.