You can define one function that you call in both cases:
function doSomething(e) { console.log('Your code here...'); } jQuery('body').on('click', '.some_div', doSomething); jQuery(window).resize(doSomething);
Remember that the reference to this will be different depending on the event raised, if it will be used in your doSomething function.
Rory mccrossan
source share