On Nov 6, 5:33 pm, Twiss <[EMAIL PROTECTED]> wrote:
> > Don't put your script inside the table.  Search for "IE table" or
> > something like that for all the examples of problems with it.
> > If that doesn't help, post a link to your map that has the "script at
> > the bottom" that didn't work.
> >   -- Larry
>
> -----------------------------
>
> Thank you for your help. I have however found the following suggestion
> online, but my question now is, How do I make my Map code above, a
> function, so i can call it like below?

You should be able to put all the javascript inside a function and
call it with the onload function.
Anything more than that is speculation, you may run in to issues with
scope if your code is much more complicated than that above and may
run into issues with that code (my head isn't as good a javascript
compiler as my browser).    Did you try it?

  -- Larry

>
> This solution will work for ALL browsers and requires very little
> effort. I modeled it after this 
> website...http://simonwillison.net/2004/May/26/addLoadEvent/
>
> Put this entire script inside of your <head> tags.
>
> The reason why this works is it loads the google map information last
> (even after the body onload event). This works for all browsers. To
> view a working example of this visitwww.sitelinksearch.comand click
> on a state.
>
> <script type="text/javascript">
> function addLoadEvent(func) {
> var oldonload = window.onload;
> if (typeof window.onload != 'function') {
> window.onload = func;} else {
>
> window.onload = function() {
> if (oldonload) {
> oldonload();
>
> }
> func();
> }
> }
> }
>
> //Setup the map
> addLoadEvent(function() {
> load();
> showAddress("raleigh, nc");})
>
> </script>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to