Skip to content

Latest commit

 

History

History
23 lines (22 loc) · 1.3 KB

File metadata and controls

23 lines (22 loc) · 1.3 KB

Dynamic web pages with JavaScript

Web developers usually talk about three languages that are used to create web pages: HTML, CSS, and JavaScript. -The HTML: gives the page structure and adds semantics. -The CSS: enhances the HTML page with rules that state how the HTML content is presented (backgrounds, borders, box dimensions, colors, fonts, etc.). -JavaScript: where we can change how the page behaves, adding interactivity. We will aim to keep as much of our JavaScript as possible in separate files. image

LINKING TO A JAVASCRIPT FILE FROM AN HTML PAGE:

  • <script src="app.js"> </script>.
  • Javascript run where it found in the HTML.

STATEMENTS:

JavaScript statements often start with a statement identifier to identify the JavaScript action to be performed. Statement identifiers are reserved words and cannot be used as variable names (or any other things).

  • note that: • Each of the lines of code in green is a statement. • The pink curly braces indicate the start and end of a code block. (Each code block could contain many more statements.) • The code in purple determines which code should run • JAVASCRIPT IS CASE SENSITIVE JavaScript is case sensitive so hourNow means something different to HourNow or HOURNOW.