Wondering if there is a way to combine identical code of 2 separate functions into 1 function.
In my case:
jQuery(\'body\').on(\'click\', \'.some_div
You can create a function to handler both the events and pass this function reference to the event handlers.
function myHandler(e) { // Long and fancy code } jQuery('body').on('click', '.some_div', myHandler); jQuery(window).resize(myHandler);