What is the difference between window.load and window.on(load)?

Many time you face that sometime either window.load function works properly and sometime window.on('load,function' ) works .Code syntax written here-:
$(window).on('load', function(){
        alert('window loaded');       
    });
$(window).on('load', function(){
          alert('window loaded');
    });
So, you want to know that what is the reason and what is the difference between these two ..
Let me tell you that there is no identical difference between them. According to functionality both are same. We can say that they are alternative way to represent window load function.
The difference is only this that .load as an event binding method has been removed or deprecated as of jquery 1.9. or above version.

Comments

Popular posts from this blog

datatable with both top and bottom scroll bar.

Display Loader and disable page while waiting for ajax request

Invalid bean property or is not readable to loading Jsp page