There are two .load
in JQuery. The first, which you can see here is an event handler for the JavaScript "load" event. It is called when a component and all its subcomponents are fully loaded. This method was deprecated from JQuery 1.8 and removed from JQuery 3.0.
The other .load
method, which can be seen here , is a method of the Ajax module responsible for loading an HTML from a server and put the content in the component where the method was called. Before the first deprecated , JQuery knew which method was being called according to the parameters entered.
None of these methods simply return true
or false
as you're looking for (the first .load
quoted returns a JQuery object). What you can do is put the code you want to run after the entire page is loaded into the .ready()
function:
$(document).ready(function(){
// fazer alguma coisa
});
Everything outside this method will run before the page is fully loaded.