开发者

Google Maps API and jQuery $.load

开发者 https://www.devze.com 2023-01-07 15:48 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消