Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Nov 2005
    Posts
    25
    Thanks
    2
    Thanked 0 Times in 0 Posts

    onclick event in ie

    <a onclick="return send_message_confirm('<?php echo $_SESSION['_aa__']; ?>','<?php echo $row_user_query['this_id_'] ?>')" href="javascript:send_message('<?php echo $row_user_query['_aa_']; ?>')" class="crumbslinks">

    i have this statement in my html code

    in firefox this works perfectly but in ie the onlick event never happens

    any ideas?

    thx

  • #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,619
    Thanks
    0
    Thanked 645 Times in 635 Posts
    an <a> tag needs an href to specify the address of the page that you are linking to for when JavaScript is disabled. If you don''t want a regular link then you probably ought to be using a <span> tag instead.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #3
    Senior Coder
    Join Date
    Feb 2003
    Posts
    1,665
    Thanks
    0
    Thanked 27 Times in 25 Posts
    Quote Originally Posted by felgall View Post
    an <a> tag needs an href to specify the address of the page that you are linking to for when JavaScript is disabled. If you don''t want a regular link then you probably ought to be using a <span> tag instead.
    It's probably worth sticking with using an anchor, but adding the anchor to the page using js, thereby avoiding the issue for non-js users. Without the ability to tab to and focus the span element, its 'onclick' event is beyond the reach of js-enabled keyboard users, etc…


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •