JS error "Object expected" only on IE9

I am only getting an error on IE9 that the error says "SCRIPT5007: Object expected". There are two identical mistakes. One is in $ (document) at the start and the other is marked as "<- error here"

    <script>
        $(document).ready(function(){
            var imagePath = "/sites/all/modules/custom/sixdegrees_right_menu/images/";
            $(".menu-holder").mouseover(function()
            {
                //$(this).children(".menu-title").children(".menu-bg").hide();
                //$(this).children(".menu-title").children(".menu-name").css({"float":"none"});
                //$(this).children(".menu-title").children(".menu-text").css({"float":"none"});

                var imgSrc = $(this).children(".menu-icon").find("img").attr("src");
                imgSrc = imgSrc.replace(imagePath, "");
                imgSrc = imagePath + "h-" + imgSrc;
                $(this).children(".menu-icon").find("img").attr("src", imgSrc);
                <- error here
                //$(this).children(".menu-title").children(".menu-name").children("img").animate({"left": "0px"}, "slow");
                //$(this).children(".menu-title").children(".menu-text").animate({"left": "0px"}, "slow");
            });
        });
    </script>

      

There are also some commented lines that I don't have enough to remove if I can't state something.

+3


source to share


1 answer


add type = "text / javascript" to your script tag and make sure you have successfully included jQuery before trying to use it.



+2


source







All Articles