When using $(document).ready(functioon(){alert("Loaded.")});
it pops up the alert box that says "Loaded." even before the page has fully loaded (in other words there're loading still going on like images).
Any thoughts?
When using $(document).ready(functioon(){alert("Loaded.")});
it pops up the alert box that says "Loaded." even before the page has fully loaded (in other words there're loading still going on like images).
Any thoughts?
$(window).on('load', function() {
//everything is loaded
});
Try out .load() instead.
$(document).load(function () {
alert('Loaded');
}
The load event is sent to an element when it and all sub-elements have been completely loaded. http://api.jquery.com/load-event/
You can read more about it here. https://github.com/codef0rmer/learn.jquery.com/blob/master/content/jquery-basics/document-ready.md