On 04/09/2009, mgvarley <[email protected]> wrote:
>
>  Hi all - I am using a templated approach for my website (implemented
>  using facelets) and have a quick question regarding performance:
>
>  Where is the best location for my script declaration e.g.
>  <script type="text/javascript"
>                 src="http://maps.google.com/maps?
>  file=api&amp;v=2&amp;key=MY_API_KEY" />
>
>  Can I put this in my template.xhtml file in which case it is in the
>  header of every page, regardless of whether I maps or not OR should I
>  just include this on pages that use maps?

Definitily only put it only pages that have a map.

You dont want visitors visiting your homepage, and loading the Maps
API javascript, and not showing them a map.


It doesnt NEED to be in the head of a page. it can go in the content -
best at the bottom. (but make sure you use a onload handler (or
similar) to actully setup the map after the script has loaded.

>
>  Also, is there any way to tell my client's browser to cache this file
>  or is this handled automatically?

Caching is controled by Googles servers.

>
>  Thanks in advance,
>
>  mark
>
>
>  >
>


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

Reply via email to