Whenever I pass .on() functions as parameters it doesn't work, but if I define the function itself inside of the parameters, despite having the exact same code, it then works
For example, this does not work:
function foo(){
alert("Yo")
}
$(window).on("click", foo())
While this does:
$(window).on("click", function(){
alert("Yo")
})