简体   繁体   English

JS错误“对象预期”仅在IE9上

[英]JS Error “Object expected” only on IE9

I am getting an error only on IE9 that the error says "SCRIPT5007: Object expected". 我只在IE9上收到一个错误,错误显示“SCRIPT5007:Object expected”。 There are 2 same error. 有2个相同的错误。 One is at $(document) at beggining and another 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 also have some commented lines which I don't have enough permission to delete it unless I can claim something. 还有一些注释行,我没有足够的权限删除它,除非我可以声称的东西。

在脚本标记中添加一个type =“text / javascript”,并确保在尝试使用它之前成功包含jQuery。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM