user1464175
user1464175

Reputation: 155

GoogleMap Api - initialize()

How can I initiliaze the google map without using the body tag(body onload=.....)

I can not use: <body onload="initialize()">

I need to use some Javascript to get the same result..but I don't know how, i tried:

    <script type='text/javascript'>  
      $(window).load(function() {
         initialize()
      });
    </script>

But it doesn't work.

Upvotes: 1

Views: 75

Answers (2)

ShatyUT
ShatyUT

Reputation: 1365

If you are using jQuery you can also do it like this:

$(function() {
    initialize();
}

Upvotes: 0

user1464175
user1464175

Reputation: 155

i just got it:

window.onload = function() {
        initialize()
    };

Can be closed..

Upvotes: 1

Related Questions