Why my function not alert when load page [javascript]? -


why function not alert when load page [javascript]?

when scroll page it's alert work good.

when resize page it's alert work good.

but when load page why not alert ?

how can ?

http://jsfiddle.net/af2kgoxu/

$(window).load(function(){     $(window).on('scroll load resize', function () {         alert("test");     }); }); 

why wrapping scroll,load, resize operations in $(window).load(function(){}); when can directly call it. change snippet below, work window scroll,load , resize.

$(window).on('scroll load resize', function () {     alert("test"); }); 

Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -