Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

onclick not working in firefox.....

Options
  • 26-07-2007 6:42pm
    #1
    Closed Accounts Posts: 2,349 ✭✭✭


    http://tcoppinger.com/new/

    onclick on the about us link should link to another page, it works in IE but not in firefox. I can't get it to do anything.

    I'm so sick of this cross-browser crap!


Comments

  • Registered Users Posts: 2,593 ✭✭✭tommycahir


    I have heard some claims that it is better to use
    self.location.replace(url)
    instead of
    self.location.href = url

    It might be worth a try.


  • Registered Users Posts: 1,393 ✭✭✭Inspector Gadget


    I think the more standard way to do this is to replace:
    <img src="Aboutus.gif" onclick="self.location.href = 'index2.html'" alt="About Us" />
    

    With:
    <a href="index2.html"><img src="Aboutus.gif" border="0"/></a>
    

    Does that help?
    Gadget


  • Closed Accounts Posts: 2,349 ✭✭✭nobodythere


    Well it will be calling a javascript function, i only changed it to self.location.href so see if something as simple as that would work.

    OnClick doesn't seem to be firing at all. Works in IE/Opera/Safari. Maybe I should report it...


  • Registered Users Posts: 1,481 ✭✭✭satchmo


    It's something to do with the last entry in your css file.


  • Users Awaiting Email Confirmation Posts: 351 ✭✭ron_darrell


    I think the more standard way to do this is to replace:
    <img src="Aboutus.gif" onclick="self.location.href = 'index2.html'" alt="About Us" />
    

    With:
    <a href="index2.html"><img src="Aboutus.gif" border="0"/></a>
    

    Does that help?
    Gadget
    Couldn't agree more. Why do people go out of there way to make things difficult? If you really, really have to have an onclick event (and btw if you do use an onclick instead of an <a> tag then the page will not work at all if the user has scripting disabled) then the correct code is:
    window.location = url;
    


  • Advertisement
  • Registered Users Posts: 1,393 ✭✭✭Inspector Gadget


    grasshopa wrote:
    Well it will be calling a javascript function, i only changed it to self.location.href so see if something as simple as that would work.

    OnClick doesn't seem to be firing at all. Works in IE/Opera/Safari. Maybe I should report it...

    The "nice" way of doing that is:
    <a href="#" onclick="function_i_want_to_call(optional_parameters)><img border="0" src="path_to_image.gif"></a>
    

    (The href="#" thing is there just for neatness)

    Hope this helps,
    Gadget


  • Registered Users Posts: 378 ✭✭sicruise


    Stick the image in a div and use the onclick with the div...


  • Closed Accounts Posts: 68 ✭✭nuada


    the div after the menu div on the page is resting on top of the menu div and so the click events are going to that div instead. add z-index:-1 to it's style to send it to the back
    <div style="z-index:-1; position: relative; top: 50%; margin-top: -200px; padding-left: 166px; margin-left: 10%;">
      <div id="photograph">
    


  • Closed Accounts Posts: 2,349 ✭✭✭nobodythere


    I owe you a hug, legend.


Advertisement