Google Maps API and jQuery $.load
My site displays the map when you dynamically go to a page using $.load of jQuery.
The problem I have is that the map开发者_StackOverflows won't load, so I have tried this.
<script to googlemapsapi>
<script>
load('lat,'lng') {
// code here etc which works
}
</script>
(Those scripts work fine when the page is directly visited).
To overcome the problem of a dynamic page load I used
<img src="img/blank.gif" onload="load(0000,0000);" />
But the problem I get now is "load is not defined".
How can I fix this please?
instead of using .load try changing it to $(document).ready(...
http://api.jquery.com/ready/
The JavaScript API has to be on the main page, the page visited before dynamic loading.
精彩评论