As I have been trying to show the map in div tag in normal html. My problem in Below code: 1. i have just called the getId() to show the map on div tag. 2.i have used maps.google.com url with just passing the location name explicity 3.then get iframe as string , i have to show it in div 4. but after click on the button, nothing wil show on my web page.
i think my problem is, how to get the iframe and show it in div tag using javascript
<!doctype html>
<head>
<script>
function getId() {
alert("function successfull");
var addressHos = "sholinganallur" + "+India";
var url = "http://maps.google.com/maps?q=" + addressHos + "&output=embed";
var str = "<iframe width='500' height='300' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' src='" + url + "'></iframe>";
document.getElementById("divmap").innerHTML = str;
}
</script>
</head>
<body>
<form method="get">
<button id="lnkBtnMap" runat="server" onclick="return getId();">show</button>
<div id="divmap" >
</div>
</body>
</html>
Thanks In Advance