Perfect - that did the job!

I tried the code from the issue you gave me but couldn't get that
working but followed your advice and read up on the AJAX Loader and
the following code works just fine.

Thanks very much, am very grateful for the help, this has been driving
me mad for the last couple of days.

mark


var GOOGLE_MAPS_API_KEY = "MYAPICODE";
var GOOGLE_MAPS_VERSION = "2";

function mapsLoaded() {
  var map = new google.maps.Map2(document.getElementById
("map_canvas"));
  map.setCenter(new google.maps.LatLng(37.4419, -122.1419), 13);
}

function loadMaps() {
  google.load("maps", GOOGLE_MAPS_VERSION, {"callback" : mapsLoaded});
}

function initLoader() {
  var script = document.createElement("script");
  script.src = "http://www.google.com/jsapi?key="; +
GOOGLE_MAPS_API_KEY + "&callback=loadMaps";
  script.type = "text/javascript";
  document.getElementsByTagName("head")[0].appendChild(script);
}

On Nov 26, 11:49 am, "warden [Andrew Leach - Maps API Guru]"
<[EMAIL PROTECTED]> wrote:
> On Nov 26, 10:27 am, mgvarley <[EMAIL PROTECTED]> wrote:
>
> > Hi Andrew and thanks for the response.  I've setup a server running
> > the same configuration and you can view my map (or not as the case may
> > be :o)) athttp://72.249.191.185/mapTest.seam
>
> > Testing this from my own machine shows the same problem as before -
> > the map displays fine on IE and Firefox but not on Chrome or Safari.
>
> It doesn't work in FF2 for me, I get an error reported
> Object cannot be created in this context" code: "9
> [sic] and then nothing to do with the API works. I think this is to do
> with the way the loader script uses document.write() to add the main
> API script -- this has come up before in relation to XHTML.
>
> You need to use the AJAX loader: 
> seehttp://code.google.com/p/gmaps-api-issues/issues/detail?id=530
>
> Andrew
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to