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

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

c# - Search and Add Comment with OpenXML for Word -