I have a script I use to load all additional scripts onto the page and I
can't seem to get it to work with loading the Map API.
This is the function I use to load scripts:

function loadScript(scriptSrc, callback) {
>
 var head= document.getElementsByTagName('head')[0];
>
    var script= document.createElement('script');
>
    script.type= 'text/javascript';
>
    script.src= scriptSrc;
>
 script.onload = function() { callback(); };
>
 script.onreadystatechange = function() {
>
 if(script.readystate == 4) callback();
>
 };
>
    head.appendChild(script);
>
 }
>

I have three different domains that the map loads from and using this
function I can set the API key dynamically when the page loads. The only
problem is that when I try to load the API this way is that I get a nasty
message from FireBug:

_mF is not defined


I did some digging and it appears what is happening is that the main.js file
is getting loaded before the loader is finished being eval'd. Am I just
stuck doing a server side key assignment to make the map work???

--~--~---------~--~----~------------~-------~--~----~
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