This question has already been answered:
- JQuery self-calling functions (function () {}) 2 responses
$(function() { //какой-то код }); This question has already been answered:
$(function() { //какой-то код }); A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .
This feature is a brief entry for
$(document).ready(function(){ ... })` It is started as soon as DOM th can be manipulated.
Source: $ (document) .ready ()
This function means that the code in it will be executed immediately after the page loads. Those. you specify functions in it and it will be executed immediately after the page loads.
The code starts as soon as the DOM is ready to interact. Sometimes it's better to use window.onload , since This code is run after the page is fully loaded:
window.onload = function() {}; In the case of jQuery like this:
$(window).load(function() {}); .onload . - VostokSistersSource: https://ru.stackoverflow.com/questions/617137/
All Articles