Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

onclick not working in firefox.....

  • 26-07-2007 06: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, Registered Users 2 Posts: 2,592 ✭✭✭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, Registered Users 2 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, Registered Users 2 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, Registered Users 2 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, Registered Users 2 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