views:

38

answers:

2

My site displays the map when you dynamically go to a page using $.load of jQuery.

The problem I have is that the maps 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?

A: 

instead of using .load try changing it to $(document).ready(...

http://api.jquery.com/ready/

No, it loads the page via an ajax method. Not .load to check the document has loaded.
GTG
A: 

The JavaScript API has to be on the main page, the page visited before dynamic loading.

GTG