This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Event(name, params) { | |
if(typeof name !== 'string') throw new Error('TypeError'); | |
var _evt; | |
_evt = document.createEvent('Event'); | |
_evt.initEvent(name, true, true); | |
if(typeof params === 'object') | |
for(var p in params) { | |
if(!_evt.hasOwnProperty(p)) { | |
_evt[p] = params[p]; |