You are on page 1of 18

CARLOS L.

ALBERT HIGH SCHOOL

COMPUTER
PROGRAMMING
.NET TECHNOLOGY
INTRODUCTION
TO JAVASCRIPT
JavaScript Syntax, Statements
and Comments
LEARNING OBJECTIVES

Understand JavaScript, Syntax, Statement


1. and comments.
Identify how JavaScript can change
2. HTML document
Recognize how JavaScript Syntax,
3. Statement and Comments works

4. Apply JavaScript in an HTML Document.


Apply JavaScript Syntax, Statement
5. and Comments in an HTML Document.
LESSON

JAVASCRIPT

HTML CSS JAVASCRIPT


define the specify the program the
content of web layout of web behavior of web
pages pages pages
LESSON

JAVASCRIPT
JavaScript was invented by Brendan Eich in
1995 and became an ECMA standard in 1997.

ECMA-262
official name of the
standard

ECMAScript
official name of the
language.
LESSON

JAVASCRIPT
5 Things JavaScript can do
JavaScript can change HTML
Content
JavaScript can change HTML
Attributes
JavaScript can change HTML Style
(CSS)
JavaScript can hide HTML
Elements
JavaScript can show HTML
Elements
LESSON

JAVASCRIPT

In HTML, JavaScript
code must be inserted
between
<script> and </script>
tags.
LESSON

JAVASCRIPT
Functions and Events

A JavaScript function is a block of JavaScript code, that


can be executed when "called" for.

A function can be called when an event occurs, like when


the user clicks a button.
LESSON

JAVASCRIPT
JavaScript in <head> or <body>
LESSON

JAVASCRIPT
JavaScript in <head> or <body>
LESSON

JAVASCRIPT
External JavaScript

External scripts are practical when the same code is used in


many different web pages.

JavaScript files have the file extension .js.

To use an external script, put the name of the script


file in the src (source) attribute of a <script> tag:
LESSON

JAVASCRIPT
External JavaScript

You can place an external script


reference in <head> or <body> as you
like.
LESSON

JAVASCRIPT
It separates
External JavaScript

Advantage
HTML and code.
It makes HTML and
JavaScript easier to read
and maintain.

Cached JavaScript
files can speed up
page loads.
LESSON

JAVASCRIPT
External JavaScript

To add several script files to one page - use several script tags:
LESSON

JAVASCRIPT
External JavaScript

External References

External scripts can be referenced with a full URL or with a


path relative to the current web page.
LESSON

JAVASCRIPT
External JavaScript

External References
QUESTIONS /
CLARIFICATIONS
HOW DID YOU DO?

I'M SURE YOU DID GREAT.


See you on our class!

You might also like