Open lazd opened 10 years ago
When passing undefined as the selector, the handler is never called (Fiddle):
undefined
// ✖ Clicks are NOT handled Gator(window).on('click', undefined, function() { log('Gator got click with undefined selector'); });
However, it is called when selector is not passed at all (Fiddle):
// ✓ Clicks are handled Gator(window).on('click', function() { log('Gator got click with undefined selector'); });
Curiously enough, doing both of the above at the same time results in neither working (Fiddle):
// ✖ Clicks are NOT handled Gator(window).on('click', undefined, function() { log('Gator got click with undefined selector'); }); // ✖ Clicks are NOT handled Gator(window).on('click', function() { log('Gator got click with undefined selector'); });
When passing
undefined
as the selector, the handler is never called (Fiddle):However, it is called when selector is not passed at all (Fiddle):
Curiously enough, doing both of the above at the same time results in neither working (Fiddle):