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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -