Mainly just preference. But there are certain things only possible with one or the other method, so often the choice is dictated by the requirements.
In the body the code is executed as the page is loading, so it can 'pause' page while loading, whereas in the head the code is usually executed after the page is otherwise loaded (hence hte onload event) - thats probably the biggest difference. If you do put it in the body its best to put it as far down the page as possible, and almost certainly the script tag shouldnt be inside a table structure (used to cause bad problems - less so now , some woraround has been added to the api) On Thu, Aug 28, 2008 at 5:45 PM, Widgets <[EMAIL PROTECTED]> wrote: > > Is better to put your map code in the header as a script or in the > body as a script? > > If it is in the header, you have to certain functions within an > overall function to be called on load in the body. <body > onload="functionname()"> > > But if its in the body you dont need to do that... > > Is one better than the other, more efficient than the other...or just > preference? > > Thanks, > Chris > > > -- Barry - www.nearby.org.uk - www.geograph.org.uk - --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
