On May 22, 10:16 pm, Bob Archer <[email protected]> wrote:
>
> Second page produces js alert: "The Google Maps API server rejected
> your request. This could be because the API key used on this site was
> registered for a different site. You can generate a new key for this
> web site at %1$s.

I saved a copy of your page locally to play with.

I can remove that error by using & in the filename instead of &amp;.
Using firebug, I can see that with &amp;, the amp; part becomes part
of the parameter name: amp;v=2 not v=2.

> My goal is to be able to write a map to the page and call the map js
> libraries dynamically - which is what you see in the second pages code
> source. I don't want to include the map js libraries unnecessarily if
> a map isn't on the page.

With my local copy successfully loading the API, I get the third map
and a couple of "GBrowserIsCompatible is not defined" errors. That
indicates that there's a race condition and the API isn't loading in
time for the first two maps. Once the code is constructing the third
one, it's there.

Why aren't you using the AJAX loader, which will load the API and then
run a callback function? The AJAX loader effectively pauses things
until the API is ready.

http://code.google.com/apis/maps/documentation/index.html#AJAX_Loader

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