[jQuery] Loading google map js on a certain point of action
Hi,
on my contact page, I have some hidden divs. One is for a google map.
This div is only shown when the user has clicked to open the div.
As I am working with smarty my template looks like this:
<span id="gmap">
{literal}
<script src="http://maps.google.com/maps?
file=api&v=2&key=ABQIAAAAp1kkS_NlSeBqN9yg50Bb9hTRRxoX5cqBbtB-
sMaIPwRkCNveuxTK0oI3HaFAjNd9OtVNIVqQYPII7g" type="text/javascript"></
script>
{/literal}
<div id="map_canvas" style="width: 518px; height: 400px;"></div>
</span>
....
<a class="plainPopup" href="#gmap"><img src="images/map.jpg" alt=""/></
a>
...
And - even the div is not shown, the google script is loading and
slows down the page.
Is there a way to load the script within my external jquery file,
where I handle the show/hide div action?
like
$('.plainPopup').click(function() {
.... load the external google file .....?
Any suggestions?
Thanks in advance!!
Bye