$.getScript("url") might help

heohni wrote:
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="" class="moz-txt-link-rfc2396E" href="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAp1kkS_NlSeBqN9yg50Bb9hTRRxoX5cqBbtB-sMaIPwRkCNveuxTK0oI3HaFAjNd9OtVNIVqQYPII7g">"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=""><img src="" 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

  

Reply via email to