The start of the script before the page is loaded?

The page is long loaded, the script inserted in thehead, called himself:
$(function(){
// my code
});

And anyway, some items are hidden in the script, have time to seem on the page, which is very bad.
July 2nd 19 at 17:35
1 answer
July 2nd 19 at 17:37
Solution
If I understand you correctly:
$(function(){
// my code
});

This code is the equivalent code
$(document).ready(function(){
// my code
});

To make the code run before the page is loaded -your code should be replaced by
(function() {
 // my code
})();
Well, if jQuery is already loaded. But in LIFE there is nothing, no? - gustave_Kertzmann52 commented on July 2nd 19 at 17:40
Well, sort of. In global scope is nothing to write randomly) - Angelita13 commented on July 2nd 19 at 17:43

Find more questions by tags Web DevelopmentjQueryHTMLJavaScript