jquery - Google maps won't load in window -


on website want open div in jquery , show route address google maps.

the problem reason map won't load. if go page directly works, if open page via jquery empty page. code:

  $("#showroute").click(function(e){   e.preventdefault();   $("#shadow").add($("#shadowcontent"),$("#closebox")).remove();   $("body").append('').append('');   $("#shadowcontent").append('sluit venster').append('');   $("#closebox").click(function(c) {    c.preventdefault();    $("#shadow").add($("#shadowcontent"),$("#closebox")).fadeout(500);   });   $("#shadow").add($("#shadowcontent")).fadein(500);   $("#shadowcontent").show().css({'width':'750px','top':'25px','left':'50%','margin-left':'-400px'});   $("#content").load('route.php?from='+$("#routefrom").val());  }); 

route.php

 [.. html tags load google maps javascript file.. ]    function initialize() {     var latlng = new google.maps.latlng(51.92475, 4.38206);     var myoptions = {zoom: 10, center: latlng,maptypeid:google.maps.maptypeid.roadmap};     var map = new google.maps.map(document.getelementbyid("map_canvas"), myoptions);     var marker = new google.maps.marker({position: latlng, map:map, title:"cherrytrees"});     marker.setmap(map);     }            jquery(document).ready(function () {     initialize();    });    [..]     <div id="map_canvas" style="width:600px;height:400px;"></div> [..] 

is there security reason or that maps won't load?

i think can load html, not javascript , expect execute loaded in dynamically.


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -