I have the following code:
(function resize(){
console.log("Ayuda!!")
})();
window.onresize = function(){ resize() }
The message shown in the console.log is just an example, obviously I have something more complex than that, the fact is that when I try to call that function when the screen is resized, it returns the following error:
Uncaught ReferenceError: resize is not defined
I have also tried this:
window.onresize = resize()
But it doesn't work either, I appreciate your comments and answers.