0% found this document useful (0 votes)
12 views7 pages

1.introduction To Javascript

JavaScript is a scripting language used widely in web pages to enhance functionality and interactivity. It works across all major browsers and is used to improve designs, validate forms, detect browsers, create cookies, and more. JavaScript and Java are completely different - JavaScript is designed for client-side scripting within web pages while Java is a more complex programming language. JavaScript code is embedded directly into HTML and is interpreted by browsers rather than compiled to machine code.

Uploaded by

gera.maahi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views7 pages

1.introduction To Javascript

JavaScript is a scripting language used widely in web pages to enhance functionality and interactivity. It works across all major browsers and is used to improve designs, validate forms, detect browsers, create cookies, and more. JavaScript and Java are completely different - JavaScript is designed for client-side scripting within web pages while Java is a more complex programming language. JavaScript code is embedded directly into HTML and is interpreted by browsers rather than compiled to machine code.

Uploaded by

gera.maahi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

INTRODUCTION TO

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.

*An HTTP cookie (also called web cookie, Internet cookie,


browser cookie, or simply cookie) is a small piece of data sent
from a website and stored on the user's computer by the
user's web browser while the user is browsing.
https://www.youtube.com/watch?v=I01XMRo2ESg
Are Java and JavaScript the Same?

► 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?

► JavaScript was designed to add interactivity to HTML pages


► JavaScript is a scripting language (a scripting language is a
lightweight programming language)
► A JavaScript consists of lines of executable computer code
► A JavaScript is usually embedded directly into HTML pages
► JavaScript is an interpreted language (means that scripts
execute without converting it in to machine code)
► Everyone can use JavaScript without purchasing a license

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 */

You might also like