In my web front-end development encountered this situation, is that there is a need for a page into multiple iframe, click tab to jump different iframe, through the hidden and display of the IFRAME to achieve, and later found in Google and other browsers can be, But in IE will produce the state of suspended animation, there is only one page display normal, the other pages are blank, and later on the internet a lot of questions about the death of IE, there is said that jquery caused, there is also said to be IE memory overflow caused, When several iframe pages are loaded at the same time, IE does not know exactly when the page loading is complete, so there will be suspended animation status.
This is the way I used to define the global variable corresponding to the IFRAME, when the first click on the corresponding tab, the corresponding IFrame loaded, and then the corresponding variable increment, do judge if it is the first click on the load IFRAME, not the first click Do not do the operation, Simulates the effects of multiple IFRAME
function SetUrl (iframe, url) {
var el = document.getElementById (iframe),
iframe = El.contentwindow;
if (EL) {
EL.SRC = ' About:blank ';
try {
Iframe.document.write (");
Iframe.document.clear ();
} catch (e) {};
The above can erase most of the memory and the number of document node records
}
el.src = URL;
}
var h = 0; IE will cause the page to feign animation when using an IFRAME, so you need to click the number of times to simulate the effect of the IFRAME
var j = 0;
var k = 0;
Jump different pages according to different parameters
function Changetab (typenum) {
var iframe = "Showiframe" + typenum;
var url = window.websiterooturl;
var data = {
Ticket: $.page.ticket,
BasEntId:fw.fwCookie.FWCookieHelper ("Basentid"),
Entid: $.page.params.entid,
Hisentid: $.page.params.hisentid
};
var params = Fw.fwUrl.FWUrlHelper.param (data);
for (var i = 1; i < 6; i++) {
if (Typenum = = i) {
$ ("#showIframe" + Typenum). Show ();
SetUrl (' showiframe ' + typenum,);
} else {
$ ("#showIframe" + i). Hide ();
};
};
Switch (typenum) {
Case ' 2 ':
URL + = ' web/ent/insertent/entproduct.htm? ' + params;
if (h = = 0) {
SetUrl (iframe, URL);
};
h++;
Break
Case ' 3 ':
URL + = ' web/ent/insertent/entguardinfo.htm? ' + params;
if (j = = 0) {
SetUrl (iframe, URL);
};
j + +;
Break
Case ' 4 ':
URL + = ' web/ent/insertent/entemergency.htm? ' + params;
if (k = = 0) {
SetUrl (iframe, URL);
};
k++;
Break
};
};