Showing posts with label Document Object Model. Show all posts
Showing posts with label Document Object Model. Show all posts

Sunday, June 18, 2017

What is V8?

V8 is a 8 cylinder engine if you are a automobile geek. However V8 is also the open source, high performance ECMA compliant JavaScript engine from none other than Google.

V8 is written in C++. It is used in many embedding applications such as Chromium and Node.js ("Node.js® is a JavaScript runtime built on top of Chrome's V8 JavaScript engine).  Just like a web browser access the document object model(DOM), V8 engine together with Chromium provides the same functionality and additionally provides all data types, operators, objects, functions etc.

In addition to compiling Javascript code, it does memory managment; assigning objects to memory; monitoring property changes and doing garbage collection.

Read more here:
https://github.com/v8/v8/wiki/Introduction

Friday, April 15, 2016

What is DOM as related to the WEB?

DOM stands for Document Object Model. It is what the User Agent (for example a browser) produces in memory when it encounters an HTML Document .
An HTML document is really a text file with mark ups (using tags). Here is an example:
<html>
<head>
<title>About Me</title>
</head>
<body>
<h1>My origins</h1>
</body>
</html>

This is a tree of elements and some text.
The element looks like this:
 <element></element>

In the html document above, the elements are: <html></html><br /><head></head><br /><title></title><br /><body></body> 
The <html></html> elements contains the rest of the elements.The <head></head> element has the <title></title> element The <title></title>just contains a string

The <body></body> can contain many more elements.The above tree is how it would be seen by the browser to create a tree, the DOM tree or simply the tree.
The DOM tree not including the spaces and carriage returns is simply this:

In a practical example like a single page mobile app (which also follows the same principles asweb page) like this one in Intel the document may have a slightly different look, but the emulating browser as well as the device browser would evaluate the document based on this DOM tree shown here.