Regarding how browser interprets HTML/CSS/Javascript -


i pretty green web development.

in 1 of courses have been told following things happen when browser reads web page.

at high level assume basic flow.

1.browser pulls html page.

2.browser understands document structure using html tags.

3.after step 2, browser understands css selectors/properties.

4.browser builds dom model now.

5.after this, javascript interpreter within browser interprets .js script

questions

1.is above flow correct ?

2.i aware html tags can manipulated javascript.

are css selectors part of dom , can manipulated javascript ?

not correct. it's complicated process.

javascript isn't run after entire page loaded, why you'll see lot of junior programmers make mistake of trying manipulate html, without checking if page has loaded.

when browser reaches element such <script> or <link> attempt pull resource, , if successful, execute resource. meaning javascript code, instance, run before dom has loaded, if <script> tag in head (where is). css works in similar way, doesn't matter when css applied, in cases, since can't crash. can create styles , change inline styles of elements, using javascript, general rule of thumb keep styles can in .css files there.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -