[OpenLayers-Users] IE weirdness

Eric Lemoine Eric.Lemoine at camptocamp.com
Wed Mar 21 10:32:52 EDT 2007


On 3/21/07, Christopher Schmidt <crschmidt at metacarta.com> wrote:
> On Wed, Mar 21, 2007 at 03:21:37PM +0100, Eric Lemoine wrote:
> > Hi list
> >
> > I've experienced weird things with OL in IE (version 7).
> >
> > The following examples are all based on examples/lite.html.
> >
> > This works:
> >
> > <body onload="init()">
> > <table><tr><td>
> >   <div id="map"></div>
> > </td></tr></table>
> > </body>
> >
> > This works:
> >
> > <body>
> > <div id="map"></div>
> > <script type="text/javascript">
> >   <!--
> >   init();
> >   // -->
> > </script>
> > </body>
> >
> > This does NOT work:
> >
> > <body>
> > <table><tr><td>
> > <div id="map"></div>
> > <script type="text/javascript">
> >   <!--
> >   init();
> >   // -->
> > </script>
> > </td></tr></table>
> > </body>
>
> When you say 'does not work': can you be more specific? is it that the
> map doens't display correctly, or is it that there is a Javascript error?

IE doesn't display the map, but doesn't show any js error.

>
> I never put the script anywhere but the <head> of the page because there
> are plenty of issues doing anything else. In this case, your init() is
> probably being called before the end of the table has had a chance to
> load, and as a result, the map has no width/height when it's
> initialized, and thus it doesn't show up correctly after initializing.

I see.

>
> Is there a specific reason you need to do it hte way you are?

Well, the <head> is in a template file, which is also included in
pages that don't display maps.

Thanks a lot,


-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com



More information about the Users mailing list