1.introduction To Javascript
1.introduction To Javascript
JAVASCRIPT
► JavaScript is used in millions of Web pages to improve
the design, validate forms, detect browsers, *create
cookies, and much more.
► JavaScript is the most popular scripting language on
the internet, and works in all major browsers, such as
Internet Explorer, Mozilla, Firefox, Netscape, Opera.
► NO!
► Java and JavaScript are two completely different languages
in both concept and design!
► Java (developed by Sun Microsystems) is a powerful and
much more complex programming language - in the same
category as C and C++.
WHAT IS JAVASCRIPT?
https://www.youtube.com/watch?v=nItSSTwBvSU
How to Put a JavaScript Into an HTML Page?
<!Doctype html>
<html>
<head> <title> Welcome</title></head>
<body>
<script >
document.write("Hello World!");
</script>
</body>
</html>
Ending Statements With a Semicolon?
► With traditional programming languages, like C++ and Java,
each code statement has to end with a semicolon (;).
► Many programmers continue this habit when writing
JavaScript, but in general, semicolons are optional!
However, semicolons are required if you want to put more
than one statement on a single line.
► Case sensitivity
► JS is case sensitive language. This means that the language
keywords, variables, function names and any other identifiers
must always be typed with a consistency of letters. For eg.
Name and NAME will convey different meanings in JS.
Comment your JavaScript Code
Comments are lines of code that JavaScript will intentionally
ignore. Comments are a great way to leave notes to yourself
and to other people who will later need to figure out what that
code does.
There are two ways to write comments in JavaScript:
Using // will tell JavaScript to ignore the remainder of the text
on the current line:
// This is an in-line comment.
You can make a multi-line comment beginning with /* and
ending with */:
/* This is a
multi-line comment */