JavaScript
Introduction
WEB BASED SCRIPTING LANGUAGE
JavaScript is a Programming Language And We
Use It to Give Instruction To Computer.
Input Code Computer Output
WEB BASED SCRIPTING LANGUAGE
1. HTML to define the content of web pages.
2. CSS to specify the layout of web pages.
3. JavaScript to program the behavior of web pages.
WEB BASED SCRIPTING LANGUAGE
JavaScript was invented by Brendan Eich in 1995,
and became an ECMA standard in 1997.
ECMA-262 is the official name of the standard.
ECMAScript is the official name of the language.
The Original JavaScript ES1 ES2 ES3 (1997-1999)
The First Main Revision ES5 (2009)
The Second Revision ES6 (2015)
The Yearly Additions (2016, 2017 ... 2021, 2022)
WHY WE LEARN JAVASCRIPT
JavaScript is a Event Based Programming
Language
Click Key Press
Double Click Key Up
Right Click Load
Mouse Hover Unload
Mouse Out Resize
Drag Drop Scroll
Benefits of learning JavaScript
Web Development Desktop App Development Mobile App Development
jQuery Electron is Angular Js
Angular Js React Js
React Js VueJS
VueJS React Native
NodeJS NodeJS
USES OF JAVASCRIPT IN WEB DEVELOPMENT
Dropdown Menu Video Players
Animated Sliders Zoom Effect
Maps Animated Gallery
Chart-Graphs Form Validations
Pop-up window Accordions
Audio Players Calendar
SOFTWARE REQUIREMENT FOR JAVASCRIPT
Html Editor
Web Browser
EDITOR FOR JAVASCRIPT
Notepad
Notepad++
VS Code
Sublime
Atom
WEB BROWSER FOR JAVASCRIPT
Google Chrome
Mozilla Firebox
Internet Explorer
Safari
JavaScript
JavaScript in <head> or <body>
You can place any number of scripts in an HTML document.
Scripts can be placed in the <body>, or in the <head> section of an HTML page, or in both.
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
Placing scripts in external files has some advantages
It separates HTML and code
It makes HTML and JavaScript easier to read and maintain
JavaScript
JavaScript Display Possibilities
JavaScript can "display" data in different ways
1. Writing into an HTML element, using innerHTML.
2. Writing into the HTML output using document.write().
3. Writing into an alert box, using window.alert().
4. Writing into the browser console, using console.log().
Trusted by students and professionals JavaScript
Using innerHTML
To access an HTML element, JavaScript can use the document.getElementById(id)
method.
The id attribute defines the HTML element. The innerHTML property defines the
HTML content
<html><body>
<h2>Hello EduTECH</h2>
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML = 10 + 8;
</script></body></html>
JavaScript
Using document.write()
For testing purposes, it is convenient to use document.write()
<!DOCTYPE html>
<html><body>
<h1>Hello EduTECH</h1>
<p>Hello EduTECH.</p>
<script>
document.write(10 + 8);
</script>
</body></html>
JavaScript
Using window.alert()
You can use an alert box to display data
<!DOCTYPE html>
<html>
<body>
<h2>Hello EduTECH</h2>
<script>
window.alert(5 + 6);
</script>
</body></html>
You can skip the window keyword.
JavaScript
Using console.log()
For debugging purposes, you can call the console.log() method in
the browser to display data.
<!DOCTYPE html>
<html><body>
<script>
console.log(5 + 6);
</script>
</body></html>
JavaScript
JavaScript Identifiers / Names
Identifiers are JavaScript names.
A JavaScript name must begin with-
A letter (A-Z or a-z)
A dollar sign ($)
Or an underscore (_)
Subsequent characters may be letters, digits, underscores, or dollar
signs.
Numbers are not allowed as the first character in names.
All JavaScript identifiers are case sensitive.
The variables lastName and lastname, are two different variables.
JavaScript
JavaScript and Camel Case
Hyphens:
first-name, last-name
Hyphens are not allowed in JavaScript. They are reserved for
subtractions.
JavaScript programmers tend to use camel case that starts with a
lowercase letter
firstName, lastName, merchantCard, webCity.
JavaScript
JavaScript Comments
JavaScript comments can be used to explain JavaScript code, and to make
it more readable.
JavaScript comments can also be used to prevent execution, when testing
alternative code.
Single Line Comments
Single line comments start with //
Any text between // and the end of the line will be ignored by JavaScript.
Multi-line Comments
Multi-line comments start with /* and end with */.
Any text between /* and */ will be ignored by JavaScript.
VERIFIED BY GOOGLE & JUSTDIAL
VERIFIED BY GOOGLE & JUSTDIAL
To Get Regular
Updates Follow
US:-
9607727888
Opposite Warje Flyover Above
Bank Of Maharashtra , Warje,
Pune-58