2

I am using ajax to load contents from another page to show in the footer. It work fine in ff, chrome, safari, and opera, but it is not working in Internet Explorer. I do not have much experience in jQuery. Here is my code:

$(document).ready(function(){
    $(" #footer #achive-box ,.related-archives .archive-post")
        .load("/_blog/Member_Area_Articles/ .show-archive .BlogPostArchive");

    $(".show-archive .BlogPostArchive").css("display", "block");
});
Josh Mein
  • 28,107
  • 15
  • 76
  • 87
Asif Islam
  • 21
  • 2

2 Answers2

3

The problem is that the element .show-archive .BlogPostArchive is loaded by the load method which is asynchronous in nature, so, the display code has to be moved to the load complete callback

$(document).ready(function(){
    $(" #footer #achive-box ,.related-archives .archive-post")
    .load("/_blog/Member_Area_Articles/ .show-archive .BlogPostArchive", function(){
        $(".show-archive .BlogPostArchive").css("display", "block");
    });
});
RAM
  • 2,413
  • 1
  • 21
  • 33
Arun P Johny
  • 384,651
  • 66
  • 527
  • 531
  • I'm confused why this isn't working for the OP in *only* IE though. This is how it should be done anyways – Ian Apr 26 '13 at 13:30
  • ahh totally agree. Ian you need a callback function to use the selectors you are loading onto the page. I missed that. – klewis Apr 26 '13 at 13:32
0

If your AJAX code is working in every other browser, then its probably a cache issue because previous files are still associated to your current window? Clear your cache in IE, close your browser, all active session accounts, and re-open it and see.

klewis
  • 7,459
  • 15
  • 58
  • 102