UNPKG

pjax

Version:

Easily enable fast AJAX navigation on any website (using pushState + XHR)

12 lines (9 loc) 312 B
var forEachEls = require("../foreach-els"); module.exports = function(els, events, listener, useCapture) { events = typeof events === "string" ? events.split(" ") : events; events.forEach(function(e) { forEachEls(els, function(el) { el.addEventListener(e, listener, useCapture); }); }); };