What is the page life cycle in javascript?
What are they?
How do they work?
There are three different phases during lifecycle of an JavaScript event. Capturing Phase. Target Phase. Bubbling Phase.
When an ASP.NET page runs, the page goes through a life cycle in which it performs a series of processing steps. These include initialization, instantiating controls, restoring and maintaining state, running event handler code, and rendering.
The lifecycle of an HTML page has three important events: DOMContentLoaded – the browser fully loaded HTML, and the DOM tree is built, but external resources like pictures <img> and stylesheets may not yet have loaded. load – not only HTML is loaded, but also all the external resources: images, styles etc.
When an event is fired on an element that has parent elements (in this case, the <video> has the <div> as a parent), modern browsers run three different phases — the capturing phase, the target phase, and the bubbling phase.
There is bunch of information out here:
JavaScript: DOM load events, execution sequence, and $(document).ready()
Info on DOM and web page lifecycle
Javascript Execution order: http://javascript.about.com/od/hintsandtips/a/exeorder.htm
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With