IE7, IE8 Ajax loaded content style does not work as a workaround

Source: Internet
Author: User

Recently done a project, using jquery Ajax for page partial replacement display, the FF inside the display is normal, but in the IE8 under the aliasing, can only show part of the effect. At first I also suspect that Ajax is not the return of HTML content format, encoding and other problems, delete some of the content of the page to test, still under the IE8 "indomitable" ... Then started Baidu, AOI.

This last sentence solves the problem: Switching the display state of a DOM element allows IE to re-render and load the CSS.

Netizen's Section code:

<script type= "Text/javascript" >  $ (function () {      $ (' #bt ') ). Click (function () {          $ (' #main '). Dialog ({               open: function () {                   var self  = $ (This);                   $.get (' markup.jsp ',  function (markup) {                       self.hide (). HTML ( Markup). Show ();  //here is the point, the actual operation is the display property                    });               }          });       });   });  </script>

The page test needs to be cautious, ie each version has to try. ^_^



IE7, IE8 Ajax loaded content style does not work as a workaround

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.