The API can be loaded on demand. At this point we'll need a link to your map to see what's going on.
Chad Killingsworth On Nov 8, 12:06 pm, winklerd <winkl...@gmail.com> wrote: > Thanks for the info. Actually, my adding of script really is an > insertion (using a method like the one you linked), sorry for the > error in my description. However, I did notice that the API script > does use document.write to add additional script elements: > > function GScript(src) {document.write('<' + 'script src="' + src + '"' > +' type="text/javascript"><' + '/script>');} > > Other than copying this to my local machine and modifying it myself, I > don't suppose there's a way around that... > > On Nov 8, 1:01 pm, Chad Killingsworth > > > > > > > > <chadkillingswo...@missouristate.edu> wrote: > > Using document.write after the DOM is finished destroys the document. > > To dynamically add the script, you need to insert a script element. > > Here's an > > example:http://blogs.missouristate.edu/web/2010/05/12/google-maps-api-v3-deve... > > > In the above article the API is loaded during the DOMContentLoaded > > event. You can substitute any trigger you wish. > > > Chad Killingsworth > > > On Nov 8, 10:56 am, Derek Winkler <winkl...@gmail.com> wrote: > > > > I'm trying to dynamically load the API only when the user needs it > > > (through a document.write, essentially). However, when it writes the > > > script element, the page reloads to a blank page. Logging the head > > > element to Firebug shows me this: > > > > <script > > > src="http://maps.google.com/maps?file=api&v=3&sensor=false&key..." > > > type="text/javascript" id="ext-gen234"> > > > Failed to load source > > > for:http://maps.google.com/maps?file=api&v=3&sensor=false&key=ABQIAAAA_Vw... > > > </script> > > > > I'm able to load other JS files via this method with no problems, > > > granted they are all locally hosted. If the script tag is present at > > > page load, everything seems to work as expected. -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group. To post to this group, send email to google-maps-js-api...@googlegroups.com. To unsubscribe from this group, send email to google-maps-js-api-v3+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.