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. That method was deprecated from Jquery 1.8 and removed from Jquery 3.0.
The other method .load
, that can be seen here, is an Ajax module method responsible for loading an HTML from a server and placing the content in the component where the method was called. Before the first being deprecated, Jquery knew which method was being called according to the given parameters.
None of these methods simply return true
or false
as you are wanting (the first .load
quoted returns a Jquery object). What can be done is to put the code you want to execute after the entire page is loaded into the function .ready()
:
$(document).ready(function(){
// fazer alguma coisa
});
Anything outside this method will be executed before the page is fully loaded.
Can you explain why you want to do this? I have doubts because I think another cumin better
– Miguel
Miguel, I’m going to create a mini system, just to have a loading while the site is loading. I know I can create a div superimposing the entire site and hide at the end of the window load, but, I was left with this doubt, put was testing the commands on the console.log and did not return true or false results.
– Lucas de Carvalho