reading-notes

View project on GitHub

OBJECTS :

Objects group together a set of variables and functions to create a model of a something you would recognize from the real world. In an object, variables and functions take on new names.

IN AN OBJECT: VARIABLES BECOME KNOWN AS PROPERTIES.
IN AN OBJECT: FUNCTIONS BECOME KNOWN AS METHODS.

The Document Object Model (DOM) :

specifies how browsers should create a model of an HTML page and how JavaScript can access and update the contents of a web page while it is in the browser window.

WORKING WITH THE DOM TREE:

Accessing and updating the DOM tree involves two steps:

1: Locate the node that represents the element you want to work with.

2: Use its text content, child elements, and attributes.

CREATING· OBJECTS USING LITERAL NOTATION:

This example starts by creating an object using literal notation. This object is called hotel which represents a hotel called Quay with 40 rooms (25 of which have been booked).

CREATING MORE OBJECT LITERALS:

Here you can see another object. Again it is called hote 1, but this time the model represents a different hotel. For a moment, imagine that this is a different page of the same travel website.

Document object model

he Document Object Model (DOM) specifies how browsers should create a model of an HTML page and how JavaScript can access and update the contents of a web page while it is in the browser window.

THE DOM TREE IS A MODEL OF A WEB PAGE

As a browser loads a web page, it creates a model of that page. The model is called a DOM tree, and it is stored in the browsers’ memory. It consists of four main types of nodes.

DOM tree: when browser load a web page it creat a model of that page.

consists of four main types of nodes.

The DOCUMENT Node.

ELEMENT Nodes.

ATTRIBUTE Nodes.

Text Nodes.

The hardest thing about writing code:

1.Learning a new technology.

2.Naming things.

3.Testing your code.

4.Debugging.

5.Fixing bugs.

6.Making software maintainable.

Thinking that sitting down and talking to customers or business people who know about the problem domain is a waste of time. It is easy to fall into the trap of thinking you understand enough of the problem to get started coding it. Best to resist the temptation to “not waste anymore time talking” and make sure you understand a problem inside and out before you try and solve it with code. It is much more expensive and time consuming to do things over than it is to do them right the first time. I learn this lesson the hard way time and time again.

Done by Omar-Zoubi GitHub