JSP rendering under IE9 may be blocked by alert. There is no problem with the IE8.
Problem Description:
A JSP that uses jquery to bind the scene initialization event (function ()), with alert () in the initial event.
IE8 the instant the Alert pop-up message dialog box, the JSP page is normally rendered under the browser;
But under IE9, the Alert pop-up message dialog box, the JSP page is not rendered, display a white page, when the click "OK" in alert, the page will be rendered.
IE9 How can we achieve the same effect as IE8?
Tried the compatibility mode of IE9, it doesn't work. The IE8 parsing mode is enforced in the JSP code, and it does not work.
Solution:
By wrapping alert or confirm in a layer of settimeout.
Copy Code code as follows:
$ (document). Ready (function () {
SetTimeout (test,0);
});
function Test () {
if (Confirm (' OK? ')) {
Alert ("you!");
}
}
Guessing conclusion:
The problem can be solved by settimeout method.
SetTimeout ("alert (' XXX ')", 0);
IE9 This problem is not related to jquery. After using settimeout, you should reboot another thread to alert, which will not prevent normal rendering of the JSP.