differentiate between normal and popup links

Discussion in 'JavaScript' started by abdou_kadri, Nov 9, 2007.

  1. #1
    Hi ALL,

    Is there a way or a function that can differentiate between normal links and popup when pressed where a warning message with only show in case normal links are pressed and won't show if the popup link are pressed

    I am using this script,

    YAHOO.namespace("example.container");
    function Warningfunction(e) {
    return confirm("ok to go?");
    }

    function init() {

    links = document.getElementsByTagName("a");
    for (var j = 0; j < links.length; j++){
    var oElementl = links.item(j);
    YAHOO.util.Event.addListener(oElementl, "click",Warnfunction);

    }

    }

    YAHOO.util.Event.onDOMReady(init);

    But this is going to grab all elements with <a> tag i.e. popup and normal links. Where the Warnfunction is a function that gives the Warning Message

    I'm be more than grateful for any help and suggestion :)
     
    abdou_kadri, Nov 9, 2007 IP