IE9 under alert blocking JSP rendering IE8 no problem _jsp programming

Source: Internet
Author: User
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.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.