开发者

Object Expected error in IE7, works in other browsers

I have a site using Google Maps v3 api and some javascript to show information on a site I am building. The site works great in all browsers, even IE8. But in IE7, I get an Object Expected error on line 34 (initialize_trip function call I am guessing). I 开发者_如何学Pythoncan't seem to figure out why I am getting this error.

The page itself is here:

http://apt4b.com/test/trips/mountain-west.php

The js file that I believe is failing is here:

http://apt4b.com/test/js/controller.js

calling the initialize_map function located here:

http://apt4b.com/test/js/map_config.js

Thanks all!


In you initialisation file (map_config.js), you have a lot of unneccessary trailling commas.

While most browsers will be permisive and ignore that, it is notorious for breaking IE.

E.g.

{
            featureType: "water",
            elementType: "all",
            stylers: [
                { hue: "#335a93" },
                { lightness: -20 },  // <-- Here, bad.
            ]
        }

Basically IE7 is probably ignoring the entire config file as bad syntax.

Haven't tried but I reckon that'll fix your problem.

Edit: The problematic spots are pretty obvious if you run it through jslint

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜