reading-notes

Dynamic web pages with JavaScript

Notes

What is JavaScript?

JavaScript adds an interactive element to websites.

Known as the scripting language for Web pages.[^1]

Do not confuse JavaScript with the Java programming language — JavaScript is not “Interpreted Java”. Both “Java” and “JavaScript” are trademarks or registered trademarks of Oracle in the U.S. and other countries. However, the two programming languages have very different syntax, semantics, and use. [^1]

JavaScript documentation of core language features:

We can distinguish 3 major parts of what we usually refer to as “JavaScript”.

  1. The language itself. This is fairly standard among the various environments, both in the various browsers and in the various server-side environments.
  2. The DOM API - how the language can interact with the various parts of a web page while in the browser. While in this respect the various browsers are getting closer to each other they still differ. Several libraries, most prominently JQuery, is trying to provide a unified API.
  3. The server API (or just API) provided by Node.js or one of the other server-side systems. [^2]

When applying JavaScript to HTML, it preferred to include an external file within the HTML similar to CSS. Another option is to embed JavaScript directly in a line in the HTML.

Ways to Use Javascript

Variables (this week)

Data Types (this week)

~Note!~

Conditions

if, else, and else if

References

  1. “JavaScript” developer.mozilla.org

  2. “Introduction to JavaScript - basic output” code-maven.com

  3. “JavaScript input with prompt and confirm” code-maven.com

  4. “JavaScript Variables” w3schools.com

Additional References

  1. “How Computers Work” code.org

Answers

  1. a container for storing information
  2. creates a container or “variable” to store information
  3. the (=) is an assignment operator. It assigns the value to the variable.
  4. User input