jquery - Google maps page loading, but not showing the map -
<script type="text/javascript"> $(document).ready(function() { $('#tab_menu a').click(function(){ $('html, body').animate({scrolltop: '201px'}, 400); $("#ajax").empty().html('<div style="text-align:center;width:950px;height:100px;background:url(/images/white.gif) repeat-y;"><table align="center" border="0"><tr><td width="950" align="center"><img src=/images/loading.gif align=absmiddle /><br/>loading map...</td></tr></table></div>'); $('#ajax').slidedown('slow', function() { $('#ajax').load('/inmap.php?=<?=$h?>'); }); }); }); </script> when inmap.php called individually renders map fine. code above, map not show.
i can call other page want without problem. whats wrong code ? note: still not show when <?=$h?> removed.
the url generated $('#ajax').load('/inmap.php?='); /inmap.php?=<?=$h?>. guess you're trying following:
$('#ajax').load('/inmap.php?=' + h); however, there's no variable called h. removing part should do.
i'm pretty sure problem google maps javascript api should loaded in file that's loading map, can't inject <script>-tag , expect external javascript file included, because won't. recommend using iframe this. end code looks this:
$(document).ready(function(){ $("#tab_menu a").click(function(){ $("#ajax").html('<iframe name="google_maps_iframe" height="100" width="950" src="inmap.php"></iframe>'); }); });
Comments
Post a Comment