We continue to say JS, we often do some things after the page loading, such as the display of some elements and hidden, some animation effect. We usually have two ways to do this, one is the Window.onload event and the other is the ready () method of jquery. So what is the difference between these two methods? Look down:The onload event is triggered after all the elements in the page and when the content is fully loaded; The
Task Readiness TableThe ready state flags for each task are placed in the ready table, with two variables osrdygrp and osrdytbl[] in the Ready table.In Osrdygrp, tasks are grouped by priority, with 8 tasks as a group. Each of the OSRDYGRP indicates whether there are tasks in each group in the 8-group task that have entered the
JQuery execution mechanism(Differences between onload and ready)
Self-Test Before conclusion: To test whether 20000 photos are inserted on the page, the number of photos is small, so I switched to the console. log () to test, so that I can see whether all of them are loaded at the bottom of the page, and the event sequence of the printed results.
VcD4KPHA + y/nTw7W9tcRKU7T6wuvKx6O6PC9wPgo8cD48cHJlIGNsYXNzPQ = "brush: java;"> console. time ('na
The Ready method in jquery implements the effect of when the page is loaded, but he is not a window.onload or doucment.onload package, but rather a standard Web browser DOM hides APIs and IE browser flaws, first of all, Let's see the code for jquery.
Copy Code code as follows:
domcontentloaded = function ()
{
Cancel event sniffing, execute Ready method if (Document.addeventlistener)
{
Ready method: When the dom object in the page is loaded, the function in the parameter is executed. Example: lt ;! DOCTYPEHTMLPUBLIC quot;-// W3C // DTDHTML4.01Transitional // EN quot; http://www.w3.org/TR/html4/loose.dtdquot;gt ;
Ready method: When the dom object in the page is loaded, the function in the parameter is executed.
Example:Http://www.w3.org/TR/html4/loose.dtd>
Use of the
The Browser executes window. the onload function is not only after the DOM tree is built, but also after all the images and other external resources are fully loaded and displayed in the browser window. therefore, if an image or other resources is loaded for a long time, visitors will see an incomplete page, even a script that depends on the dynamically added element is executed before the image is loaded, resulting in a script error.
Window. onload = function () {testDiv. innerHTML ="
动态创建的p"
this driver uses modern Linux WiFi infrastructure and should work flawlessly with Networkmana GER, Wicd, wpa_supplicant and Such.aur/mt7601u-git2015.04. --1(3) Driver forMediatek mt7601u USB BGN WiFi Dongleaur/test_mt7601u0.1-2(0) TestifMT7601U (WiFi) is loaded. If not, itInstallItMy heart is happy! Actually have ' mt7601u-ap-dkms ' this ready-made bag, directly to open the outfit!$ yaourt-s mt7601u-ap-dkms#此处省略一万字 ... :: Do you want to install it? [
1. Timing of execution:window.onload: You must wait for the page to complete (including images, etc.) before executing the package code$ (document). Ready (): Just wait for the DOM structure in the Web to load and execute the package code2. Number of executions: window.onload: Executes only once, if the second time, then the first execution will be overwritten$ (document). Ready (): can be executed multiple
Article Title: Father of Linux: Linux is ready for green energy conservation and environmental protection. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Linux leader Linus Torvalds said at the Melbourne Linux conference this week that the green architecture and tools for Linux are
Web development is often done in jquery with $ (document). The Window.onload method in ready () and JavaScript, both of which are loaded after the page is loaded, but there is a big difference. Recently encountered such a problem, query a number of articles, do a summary.To put it simply, use the following table to indicate:
jquery's Ready () and Javascrpit's load ()
Window.onlo
There is a ready-made form system, that is, forms created in the background support various types, such as single choice, multiple selections, linkage drop-down box. In addition, after the user fills in the data, can the background perform relevant statistics .. Perform related query and export according to the set fields .... There is a ready-made form system, that is, forms created in the background suppo
In JavaScriptfunction(){ alert(“text1”); }; is equivalent to in jquery.$(window).load(function(){ alert("text1");});They are all used to run the alert function within a function when all elements of the page, including external reference files, images, etc. are loaded. The Load method can only be executed once, if more than one is written in the JS file, only the last one can be executed. (Beginners often in the page structure of the element directly write behavior function, this is very ug
1. Execution time difference:$ (document). Ready (function () {}) is abbreviated to $ (function () {}), which executes after the page frame is loaded.Window.onload=function () {} is executed after all pages have been loaded (including pictures).2. Number of execution differences:$ (document). Ready (function () {}) can be executed more than once.Window.onload=function () {} Executes only the last one at mul
jquery provides us with some very useful functions.Ready: Load functionTraditional events can only be bound to a function following a function that overrides the previous functionJS with window.onload = function () {};jquery in $ (document). Ready (function () {} or $ (). Ready (function () {}Multiple simultaneous loads can be loadedLoad events are most commonly used in jquery$ (function () {})Equivalent to
an easy-to-launch "member +" open platform will be officially launched on July 1, and is currently receiving Partner Developer Award applications. We are ready for 5 million, take it boldly! ten years of sharpening a swordunder the impact of the Internet, the brutal collapse of the tide is a wave of waves, and the vast majority of businesses are not sticking to the line, is the blind worship online, countless facts prove that the entity Enterprise/mer
The Alibaba Group will usher in a high-speed development in the next two years, and 3 years later, Alibaba will become one of the top 500 companies in the world and become the top 5 or even 3 of the world's internet companies, said Mr. Wei. At the same time, Alibaba, although no specific timetable for the listing, but also ready to be listed at any time.
In the face of the future, Alibaba full of confidence data map
3 years later to enter the world's
Label: Style Color Io ar SP data 2014 on Art
The era of digital economy has arrived. For consumers, this means they can interact with the virtual world and the real world in a more colorful way anytime and anywhere. For enterprises, this means that their operations will change dramatically, and they also have the opportunity to gain a deeper understanding of customers and turn these insights into value. For CIOs, this means they need to address increasing challenges in terms of channels, operati
1. Most commonly used is also the most standard$ (document). Ready () {});2. Is the above shorthand:$ (function () {}) ;3. All right! I admit that this is the way to soy sauce.JQuery (document). Ready (function () {});and jquery (function () {});----------------------------the above three effects are the same---------------------------------4.jQuery (function ($) {});The fourth way is generally used when de
Recently do Plug-ins encountered problems, the record is as follows:
This article illustrates the execution order of multiple $ (document). Ready () in the form of an instance, where multiple $ (document) can be seen. The execution order of ready () is not a simple sequential execution and has a certain relationship with the nesting level. The specific example code is as follows:
TtttttttttttKkkkkkkkkkkk
A normal Windows system does not show any window reminders when we get to the desktop, and if the user has a "Windows drive not Ready" Prompt window when they turn on on the desktop, there are some problems with your computer system. So how do you solve the Windows drive that users are not ready for? The following is a small series for everyone to bring the detailed solution!
Solving method
1, in the Win7
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.