Asynchronously loading Google Map in iFrame with onClick using Java.
-
Hi,
Well I have been trying for days with this one…
I have a link that when clicked toggles a div visibility with a google map inside it. The map is in an iFrame (just pasted from the google map shortcode generator). This is not very difficult and it works.
What I want is for the map/iframe not to load, even hidden within the div, until the user clicks “Show/Hide map”. I want the div to be visible and map to load asynchronously and on command after the page is loaded and when a user clicks “Show/Hide map”. Thus speeding the page up, reducing data…
This is where I eventually gave up…
<script type=”text/javascript”>
function hideshow(which){
if (!document.getElementById)
return
if (which.style.display==”block”)
which.style.display=”none”
else
which.style.display=”block”
}
function loadmap(){
document.getElementById(“mapframe”).src=”http://maps.google.com.au/?ie=UTF8&ll=-32.830735,147.451465&spn=8.655905,14.128418&t=h&z=6&output=embed”
}
</script><div id=”adiv” style=”font:24px bold; display: none”>
The problem is with the src with google maps. I can use this above method to change the src to other basic URLs but not the URL for the google map.
Why is this. What do I do? Please help.
-
You did not specify a blog address or reason for posting when you created this topic.
This support forum is for blogs hosted at WordPress.com. If your question is about a self-hosted WordPress blog then you’ll find help at the WordPress.org forums.
If you don’t understand the difference between WordPress.com and WordPress.org, you may find this information helpful.
If you forgot to include a link to your blog, you can reply and include it below. It’ll help people to answer your question.
This is an automated message.
-
The site you are asking about does not seem to be hosted on WordPress.COM so you need to make friends over at WordPress.ORG the keepers of the software you are using.
This site is for support of sites hosted on WordPress.COM. You should address your questions to WordPress.ORG the keepers of the software you are using: http://wordpress.org/support/
For more on the difference: http://support.wordpress.com/com-vs-org/
- The topic ‘Asynchronously loading Google Map in iFrame with onClick using Java.’ is closed to new replies.