You are on page 1of 5

IT REVIEWER - is an OOP scripting language of HTML

and Web.
Adding styles to tables - Netscape
>Table Borders - smaller and simpler commands.
*border-color - Text based.
-Assigns color to borders. Add a - code is run on a browser only.
corresponding hexadecimal umber for the - Makes computers do what you want
desired color. them to do.
Examples: - Executes in Host Environment
border-color: Red; ( mostly Browser).
border-color: Grey; - Interpreted language.
*border-width - Adds interactivity to your websites
-Refers to the thickness to the border - Games
lines. Add numerical values to points or - Responses when button are pressed
pixels to set the thickness of a table’s - Dynamic styling
border. - animation
Examples:
The Three Layers of the Web
border-width: 5px;
border-width: 2px; -> HTML for Content
*border-style  <p class=“warning”>There is
-Refers to the type of border that wil be no <em>download link</em>
used in the table. Typical values used are on this page.</p>
dashed, dotted and solid.
Examples: -> CSS for Presentation
border-style: dashed;  .warning { color: red; }
border-style: dotted;
-> JavaScript for Behavior
border-style: solid;
border-style: double;  <script type=“text/javascript”>
border-style: groove; window.alert(document.getEl
border-style: ridge; ementsByClassName(“warning
border-style: inset; ”)[0].innerHTML) </script>
border-style: outset;
DID YOU KNOW…………
>border-collapse property
-enables data cells to share borders with  JAVA
other table data cells. The values for this - Object oriented programming(OOP)
property are collapse and separate. language
*border-collapse
-enable adjacent table data cells to - Sun Microsystems
share the same borders. - Larger and complicated commands.
*border-separate
-enable table data cells to maintain - Create “standalone” application.
individual borders (default).
VALUES:
- Creates applications that run in a
border-collapse: collapse;
virtual machine or browser.
border-collapse: separate;
History of JavaScript Brendan Eich
 JavaScript - Invented JavaScript in May 1995 with
- is the programming language of his initial draft that he made in 10
HTML and Web. DAYS.
HISTORY - It is formed of commands that tell the
browser what to do.
- 1993, National Centre for
Supercomputing Applications (NCSA document.write (“text”)
Mosaic) – first graphical web
- Which writes text string of text as an
browser.
output when the command is
- 1994 Mosaic Communications
executed by the Web browser.
(Mosaic Netscape) – successful web
browser that has the same authors, For example:
but different codes. <script type= “text/javascript”>
- Marc Andreessen – He is the co-author of
Mosaic { document.write (“<p> First statement
- Language specification ECMASCRIPT </p>”);
published the first edition of ECMA-
document.write (“<p> Second statement
262 standard on june 1997.
</p>”);
- ECMASCRIPT 2 – June 1998
- ECMASCRIPT 3 – December 1999 document.write (“<p> Third statement
ECMASCRIPT 4 – 2000 (never </p>”); }
completed) </script>
- ECMASCRIPT 3.1 – 2007
- 2005, AJAX – set of technologies Blocks or Compound Statements
using which data can be loaded in - Is a series of statement placed within
background keading to more dynamic the curly brackets { and } and is
web sites. executed together by Web browsers.
- PROTOTYPE
- DOJO For example:
- JQUERY <script type= “text/javascript”>
- July 2008, Oslo
{ document.write (“<p> First statement
- ECMASCRIPT 5 – December 2009
</p>”);
- ECMASCRIPT 5.1
- ECMASCRIPT 2015 document.write (“<p> Second statement
- ECMASCRIPT 2016 </p>”);
- ECMASCRIPT 2017
document.write (“<p> Third statemenr
- Created by Brendan Eich in 1995 for
</p>”);
Netscape.
- MAY-Mocha and later LiveScript- }
SEPTEMBER. Variables
- DECEMBER-name was changed to
JavaScript. -JavaScript variables are containers for
- In 1996-1997 JavaScript 1.1 was storing data values.
submitted to ECMA as a proposal. -In this example, x, y, and z, are variables.
TC39 was assigned to standardize the
Example
syntax and semantics of the
language. var x = 5;
- TC39 released ECMA-262 known as
var y = 6;
ECMAScript 2017.
- ECMAScript is basis for all the var z = x + y;
JavaScript implementations. All JavaScript variables must be identified
STRUCTURE with unique names.

Statements These unique names are called identifiers.


Identifiers can be short names (like x and y) Operator Description
or more descriptive names (age, sum,
+ Addition
totalVolume).
- Subtraction
Boolean
* Multiplication
- - Has two values: TRUE and FALSE.
- Each of this values can be mapped to / Division
corresponding numerical values. And % Modulus
to be complete or to display its role in
javascript code, it often work with if ++ Increment
( ) statements. -- Decrement
take step 1 (x = =1); //step 1 is true = Assign
take step 2 (x = =2); //step 2 is false += Add and Assign
Operators -= Subtract and Assign
- Are used to combined (or *= Multiply and Assign
“concatenate”) function and strings,
/= Divide and Assign
perform arithmetic, or combine
values to other values. %= Modulus and Assign
<!DOCTYPE html> Guidelines for writing JavaScript
1. JAVASCRIPT IS CASE-SENSITIVE. Write
<html>
your code according to the letter
<head> </head> cases that they are presented in the
<body> reference, as well as according to the
way you write your rules, variables,
<h1>JavaScript Operators</h1> object and other codes.
<p>Adding a number and a string, returns a 2. < script type=text/javascript>
string.</p> </script>Each time you inserted a
Javascript code in your HTML code,
<p id="demo"></p>
always start with the opening < script
<script> type=text/javascript> tag and then
enclose the script with closing tag.
var x = 5 + 5;
3. Javascript can be inserted in the head
var y = "5" + 5; of your HTML structure, between
var z = "Hello" + 5; <head></head>.
It can also be inserted in the body
document.getElementById("demo").innerH section of your HTML.
TML = 4. Use curly bracket { and } to enclose
x + "<br>" + y + "<br>" + z; statements. A sequence of
statements inside curly brackets is
</script>
called compound and is executed
</body> together.
5. Javascripts ignores white space.
</html>
Spaces, tabs, and new lines are called
JavaScript Arithmetic Operators newlines.
- Arithmetic operators are used to 6. To break a line of code, use backslash
perform arithmetic on numbers (\). This equivalent to inserting the
(literals or variables). <br /> tag I your HTML code.
7. To add comments to a Javascript </script>
code , type your comments between PROPERTIES
the <!-- and // -- > - Are values associated with objects
For example: and hold the attributes of objects
<!-- This is a comment //--> within the script.
If you are hiding comment with multiple Example: in writing properties
lines. document.bgcolor – sets the background
Working with Objects, Properties and color property of the web page.
Methods -alinkColor -
OBJECTS -Anchors [ ]
JAVASCRIPT -bgcolor
- is an object-oriented programming -embeds [ ]
language, and such, treats all -fgcolor
elements in your HTML document as -forms [ ]
object. Each object has a container -images [ ]
called WINDOW. -last modified
LOCATION -linkColor
- location of the HTML document. -links [ ]
HISTORY- record of all sites the When String Objects
browser has visited.  Can be any text enclosed in
DOCUMENT quotation.
- complete details of the Web page, Example:
including forms, elements, images <script type=“type/javascript”>
and links. {
FORM Var text=“String string!”;
- contains the information about any
METHOD DESCRIPTI SYNTAX
form in the current Web page.
S ON
METHODS AND PROPERTIES
METHODS Anchor ( ) -Creates a Object.achor( );
- are the special programming link or
commands associated with objects. text
Always remember that objects have anchor.
- their own set methods.
Big ( ) -Increases Object.big( );
- object.method -> Statement
the font
For example:
size of the
<script type= “text/javascript”>
string.
{
document.write (“<p> First statement Fontcolor -specifies Object.fontcolo
</p>”); () string r( );
document.write (“<p> Second statement color. Object.fontsize(
fontsize( ) - Displays );
</p>”);
document.write (“<p> Third statemenr a string in
</p>”); specified
} size.
toLowerc -displays a Object.toLower
ase ( ) string in a case( );
lowercase
.
toUpperC -displays a Object.toUpper
ase ( ) string in a case( );
lowercase
.
Document.write(txt.length);
}
</script>

Example:
<script type=“type/javascript”>
{
var txt=“lorem ipsum”;
document.write(txt . toUpperCase( ) );
}
</script>
Where:
Object =txt
Object string = “lorem ipsum”
Method = document.write
Syntax = txt . toUpperCase

<script type=“type/javascript”>
{
var text=“lorem ipsum”;
document.write(txt.tolowerCase( ) );
}
</script>

Where:
Object =txt
Object string = “lorem ipsum”
Method = document.write
Syntax = txt . tolowerCase

<!DOCTYPE html>
<html>
<body>
<h2>JavaScript is Case Sensitive</h2>
<p>Try change lastName to lastname.</p>
<p id="demo"></p>
<script>
var lastname, lastName;
lastName = "Doe";
lastname = "Peterson";
document.getElementById("demo").innerH
TML = lastName;
</script>
</body>
</html>

You might also like