* cross browser add event method * * @param {Element|HTMLDocument} object * @param {string} type * @param {Function} callback * @returns void
(object, type, callback)
| 213 | * @returns void |
| 214 | */ |
| 215 | function _addEvent(object, type, callback) { |
| 216 | if (object.addEventListener) { |
| 217 | object.addEventListener(type, callback, false); |
| 218 | return; |
| 219 | } |
| 220 | |
| 221 | object.attachEvent('on' + type, callback); |
| 222 | } |
| 223 | |
| 224 | /** |
| 225 | * takes the event and returns the key character |