Event Callers

Discussion in 'JavaScript' started by cakefish, Jun 29, 2007.

  1. #1
    Is there anyway to tell where an event is coming from (I.E. a user click vs an in code change of the index of a combo box)?
     
    cakefish, Jun 29, 2007 IP
  2. mjamesb

    mjamesb Member

    Messages:
    88
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    48
    #2
    If you are passing in the event object to the method you can check to see if it has a target or srcElement. The Event Object is different from IE to Others. IE is srcElement whereas FireFox, NS, SF are target. Do a little hunting on the event object. Your method can check the target and if it is null then you know it didn't happen from the user clicking on a element.
     
    mjamesb, Jun 30, 2007 IP