使用此 javascript 在 IE7 中收到“对象不支持此属性或方法”错误,以及选项卡未正确定位的问题

Getting "Object doesn't support this property or method" error in IE7 with this javascript and problems with tabs not anchoring properly

本文关键字:选项 错误 问题 定位 IE7 javascript 属性 不支持 对象 方法      更新时间:2023-09-26

现在收到错误网页错误详细信息

用户代理:Mozilla/4.0(兼容;微星 8.0;视窗NT 6.1;赢64;x64;三叉戟/4.0; .NET CLR 2.0.50727;SLCC2; .NET CLR 3.5.30729; .NET CLR 3.0.30729;媒体中心 PC 6.0; .NET4.0C)时间戳:星期五, 15 六月 2012 02:20:10 UTC

消息:对象不支持此属性或方法行: 210字符: 2代码: 0URI:http://www.seanprovost.com/frah_dev/j/s_jsInit.js

我的选项卡在IE7中没有正确定位

$("#map").gMap({
            markers: [{ 
                latitude: 34.816117,
                longitude: -86.491022,
                html: "Flint River Animal Hospital",
                icon: { image: "i/googlePin.png", 
                      iconsize: [26, 46],
                      iconanchor: [12, 46],
                      infowindowanchor: [12, 0] },
                }],
            zoom: 14
});

----> $('#boaSectLeft').localScroll({ 目标:"#sections" });

有人知道这是怎么回事吗?

删除最后一个逗号:

$("#map").gMap({
    markers: [{ 
        latitude: 34.816117,
        longitude: -86.491022,
        html: "Flint River Animal Hospital",
        icon: { image: "i/googlePin.png", 
            iconsize: [26, 46],
            iconanchor: [12, 46],
            infowindowanchor: [12, 0] }//Here
    }],
    zoom: 14
});

因为icon是对象的最后一个属性。

但是,它应该可以工作,至少在Chrome中是这样。

这可能是问题所在。 我看到您在定义icon对象后有一个逗号(即第 infowindowanchor: [12, 0] },行末尾的逗号,这会导致 IE 出现问题。