a newby question - please help

Discussion in 'JavaScript' started by pingu, Jan 31, 2007.

  1. #1
    Hi everyone
    I have been setting up my site to work with google maps.
    I have a find.php page which contains the maps, and i wish to link to this page from my sidebar (present on all pages).

    I use the code:

    <a href="find.php" onclick="find();return false;">find us</a>

    If i happen to be on the find.php page it works fine, but if i am on any other page, it redirects but does not display the map.

    Please, does anyone know why?

    Many thanks
     
    pingu, Jan 31, 2007 IP
  2. marty

    marty Peon

    Messages:
    154
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #2
    My guess is that the find() JavaScript Function isn't getting executed when you are clicking from another page. Executing the find JavaScript Function at the botton of the find.php page might fix it.

    I hope that helps :)
     
    marty, Jan 31, 2007 IP
  3. pingu

    pingu Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks for the reply marty, it does get called i think, because if i add an alert in, it displays. The url is "www.reapfuels.co.uk". If you click on the 'find me' link twice on the bottom right, youll see what i mean.
     
    pingu, Jan 31, 2007 IP
  4. marty

    marty Peon

    Messages:
    154
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Hey Pingu,

    No problem. I started playing with your code locally and it looks like the callme function is trying to use Gmap2 Object before it's actually loaded into the browser.

    Very strange...

    Good luck,

    Marty
     
    marty, Jan 31, 2007 IP
  5. pingu

    pingu Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks for your time Marty
     
    pingu, Jan 31, 2007 IP