b_dev
b_dev

Reputation: 2598

Why a Google Maps API site works on Firefox, but not on Windows Explorer?

My site that based on the Google Maps API works on Firefox but not on Windows Internet Explorer (IE8).

The problem is that the checkboxes to the right of the map are not triggering the new map layers in IE8 as they do in Firefox.

I am looking for direction on where to begin fixing my site to make it work properly using IE8.

OS is Windows 7.

Upvotes: 1

Views: 1486

Answers (3)

nss
nss

Reputation: 561

This is sort of crazy, but according to this SO question: Do DOM tree elements with ids become global variables?

Elements of the DOM tree can be referenced as global variables in Internet Explorer.

Your problem is with the methods CreateActivity* in data_mapping_tools.js.

Specifically, the for-loop that creates the markers references a bunch of global variables, one of which is "title". This conflicts with the globally created "title" object which you cannot assign to, apparently.

You should really fix your CreateActivity* methods to not refer to global variables by putting "var" before the variable declaration.

Upvotes: 1

b_dev
b_dev

Reputation: 2598

Internet Explorer 8 (IE8) browser is much pickier than Firefox.

So using this Markup Validation Service is a good direction to handle this sort of problem.

The trick is to get your HTML markup completely clean until the service says 'congratulations'.

Upvotes: 0

Daniel T.
Daniel T.

Reputation: 38420

I don't know if this is the actual problem, but in your HTML, you have:

<body onload="initialize()">

I remember hearing some issues about the onload event firing too early in some browsers, before the DOM is completely ready. Since you're including jQuery as well in the header, I recommend removing the onload event and putting it in Javascript instead (in the <head> tag):

<script type="text/javascript">
    $(function() {
        initialize();
    });
</script>

This will use jQuery to detect when the DOM is ready and call initialize().

Upvotes: 1

Related Questions