2 jquery .load calls in one function – only first works in IE 8

The below code works fine in all browsers except IE 8. I’m not worried about IE 7. IE 8 uses the jquery .load call the first time correctly. (minus the background color, I’m thinking this is just a css problem). The 2nd .load call doesn’t work at all. Any help?

$  ("#product-logos li").click(function() {

var logoclick = $  (this).attr("class");

for (x=0; x<productLogos.length; x++) {
    if (logoclick==productLogos[x].attr("class")) {
        //load correct content type
        $  ("#loaded-content").load("products.html ." +logoclick, function() {

            //make first active class
            $  ("#product-title-display ul li:nth-child(1)").attr('id', 'active');
            $  (".accordion").accordion();
            $  ("html, body").animate({scrollTop: $  ("#product-logos").offset().top-20}, 1000);
        //end of load function

        //start of 2nd ajax call
            var productTitle = new Array();
            $  ("#product-title-display ul li").each(function() {
                productTitle.push($  (this));
            });

            $  ("#product-title-display ul li").click(function() {
                $  ("#product-title-display ul li").removeAttr("id", "active");
                $  (this).attr('id', 'active');
                var titleclick = $  (this).attr("class");
                for (y=0; y<productTitle.length; y++) {
                    if (titleclick==productTitle[y].attr("class")) {
                        $  ("#prod-content").load("indiv-products.html ." +titleclick, function() {
                            $  (".accordion").accordion();
                        });
                    }
                }
            });
        });
    }
    else {
    }
}

});

newest questions tagged jquery – Stack Overflow

About Admin