Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Apr 2008
    Thanked 0 Times in 0 Posts

    CSS Styles not applying on AJAX-loaded content IE7

    Hey there,

    I've got an issue where I'm replacing a portion of my page with AJAX, and the content of the loaded page is also being refreshed onTimeout every 1 second (it's a scan of sorts, and a number is being increased so it's refreshed every second to display the new #)

    The issue is that in IE7 (only. It works perfect in FF, Safari of course), while the onTimeout keeps firing, the CSS styles are not being applied to the content.

    However, when the scanning is done, and all pages are found, the onTimeout stops firing, and it then will apply the stylesheet upon the last final rendering of the page's content.

    Again this is only doing this in IE7.

    Any ideas of why this may be happening? There is one or two styles inline, but 99% of it is using the normal main.css stylesheet, and there's a bit of <script> in there, but also 99% of that is external as well.

    Any things to try would be great, or hopefully someone's run into this issue before??


  2. #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Between DC and Baltimore In a Cave
    Thanked 94 Times in 88 Posts
    hacky solution, but it might work

    set the display to none and than back to what it should be

    myDiv.innerHTML = xhr.responseText;
    myDiv.style.display = "none";
    myDiv.style.display = "";
    It will force a redraw, might or might not work.

    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts