Skip to content
the poor coder

function call ready resize and load

Poor Man
Published
Reading time
1 min read
On this page

Function Call Ready, Resize, and Load in HTML#

Function Call Ready, Resize, and Load are three important functions in HTML that help to enhance the performance of your website or web application. Here is a brief explanation of each function:

Ready Function:#

The Ready function is an event that is triggered when the DOM (Document Object Model) is ready. It means that all the elements on the page have been loaded and we can now manipulate them using JavaScript. In jQuery, it is represented by the $ sign, followed by the function keyword.

Text

$(document).ready(function(){
    // Your code here
});

This function ensures that your code executes only after the DOM has finished loading. It is important to use this function to prevent any issues that may arise due to elements not being fully loaded or not yet created.

Resize Function:#

The Resize function is triggered when the browser window is resized. This function is useful when you want to change the layout or style of your website according to the size of the user's screen. In jQuery, it is represented by the $ sign, followed by the resize() function.

Text

$(window).resize(function(){
    // Your code here
});

This function allows you to apply different CSS styles or layout changes based on the user's screen size. It is important to note that this function can be resource-intensive, so it should be used sparingly.

Load Function:#

The Load function is triggered when all the assets on the page have finished loading, including images, videos, and other resources. In jQuery, it is represented by the $ sign, followed by the load() function.

Text

$(window).load(function(){
    // Your code here
});

This function is useful when you want to perform some action after all the assets on the page have finished loading. It can be used to display a loading animation or to start a slideshow after all the images have loaded.

Overall, these three functions are important in ensuring that your website or web application runs smoothly and efficiently.

Keep going

2023

how to sort an array

How to Sort an Array If you have an array and you want to order its elements in a specific way, you need to use a sorting algorithm. There are several sorting algorithms available, but two of the most commonly used are…

javascript2 min read
2023

jquery mobile or desktop

jQuery Mobile or Desktop? As a web developer, I have had some experience with both jQuery Mobile and jQuery Desktop. Both frameworks have their pros and cons, and which one to use really depends on the specific project…

javascript1 min read
2023

node.js folder structure

Node.js Folder Structure If you are new to Node.js, it can be daunting to create a folder structure that will work for your project. The structure you choose will depend on the size and complexity of your project. Here…

javascript1 min read
ESC