Hi iam trying to load googlemaps when the new page is loaded ..but itz not working below is my code
<script type="text/javascript">
var query = location.href.substring((location.href.indexOf('?')+1), location.href.length);
if(location.href.indexOf('?') < 0) query = '';
querysplit = query.split('&');
query = new Array();
for(var i = 0; i < querysplit.length; i++){
var namevalue = querysplit[i].split('=');
namevalue[1] = namevalue[1].replace(/+/g, ' ');
query[namevalue[0]] = unescape(namevalue[1]);
}
window.onload = function(lat,lng){
// Do stuff with query string data here.
alert(query['latitute']);
var map;
//code write to load map on right side
var myLatlng = new google.maps.LatLng(lat,lng);
map = new google.maps.Map(document.getElementById('map'), {
mapTypeId: google.maps.MapTypeId.ROADMAP,
center: myLatlng,
zoom: 10});
}
</script>
my goal is when i click link on firstpage the second page should load with the map taking the latlng from firstpage which are hardcoded..the alert statement is wrking but not the map load..trying to implement it in jquery or js..Any help is appreciated
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…