108 reputation
3

pure_code

The line between opinion and fact needs a huge guardband!

I only support modern browsers so that I don't have to read quirks-mode articles.

Code Bin

function addEvent (element, type, callback) {
    if (element.addEventListener) { 
        element.addEventListener(type, callback); 
    } else if (element.attachEvent) { 
        element.attachEvent("on" + type, callback); 
    } else {
        $.error('addEvent: no event system')
    }
}

Top Tags (3)

Score 0
Posts 1
Score 0
Posts 1
Score 0
Posts 1

Top Posts (1) All Questions Answers | Votes Newest

Badges (3)

Gold
Silver
Bronze 3

Rarest