Skip to content

Instantly share code, notes, and snippets.

View monitorEvents.js
function monitorEvents(element) {
var log = function(e) { console.log(e);};
var events = [];
for(var i in element) {
if(i.startsWith("on")) events.push(i.substr(2));
}
events.forEach(function(eventName) {
element.addEventListener(eventName, log);
});
@eridal
eridal / simple.js
Created Oct 30, 2015 — forked from paton/simple.js
Super simple implementation of define() and require() used in Localize.js (https://localizejs.com)
View simple.js
var define, require;
(function() {
var modules = {};
require = function(name) {
return modules[name]();
};
define = function(name, fn) {