SlideShare a Scribd company logo
www.webstackacademy.com ‹#›
Introduction
JavaScript
www.webstackacademy.com ‹#›

History

Advantages

Limitations

Script Element

Coding Convention
Table of Content
www.webstackacademy.com ‹#›www.webstackacademy.com ‹#›
Introduction
(JavaScript)
www.webstackacademy.com ‹#›
JS – What?
●
A programming language designed for web pages
●
It is embedded directly into HTML Pages
●
An interpreted, client-side, event based language
●
It is dynamic, lightweight and case-sensitive
www.webstackacademy.com ‹#›
HTML, CSS & JavaScript
www.webstackacademy.com ‹#›
JavaScript History
●
Created by Brendan Eich (co-founder of Mozilla) in 1995
during his time at Netscape Communications
●
It was inspired by Java, Scheme and Self
●
Originally called Mocha (a name chosen by Marc
Andreessen)
www.webstackacademy.com ‹#›
JavaScript History
●
In Sep 1995 the name was changed to LiveScript
●
Then, in Dec 1995, upon receiving a trademark license
from Sun, the name JavaScript was adopted
●
The general-purpose JavaScript engine had been
embedded in web browsers (Netscape, IE, etc..)
www.webstackacademy.com ‹#›
JavaScript History
●
The ECMA-262 (European Computer Manufacturer’s
Association) Specification defined a standard version of
JavaScript language
●
ECMAScript Edition 1 First standardized version of
JavaScript
●
ECMAScript Edition 2 is the second official standard
www.webstackacademy.com ‹#›
JavaScript History
●
ECMAScript 3 (ES3) was released in December 1999. More advanced
language, Includes regular expressions and exception handling
●
ECMAScript 4 (ES4) A new standard includes features such as JSON
(JavaScript Object Notation) & class based object-oriented programming
●
ECMAScript 5 (ES5) was released in December 2009. It adds in getter
and setter properties, introduces features for robust programming via a
strict mode and JSON handling arrays
●
ECMAScript 6 (ES6) was released in June 2015, and is the latest official
version of JavaScript
www.webstackacademy.com ‹#›
JavaScript Advantages
●
JavaScript is executed on the client side
– The code is executed on the user's processor instead
of the web server
– This means less load on server
●
JavaScript is relatively easy language
– The JavaScript language is relatively easy to learn and
comprises of syntax that is close to English
www.webstackacademy.com ‹#›
JavaScript Advantages
●
Increased interactivity: We can create interfaces that
react when the user hovers over them with a mouse or
activates them via the keyboard
●
Richer interfaces: You can use JavaScript to include such
items as drag-and-drop components and sliders to give a
rich interface to your site visitors
www.webstackacademy.com ‹#›
JavaScript Limitations
●
JavaScript cannot write to files on the server without the
help of a server side script
– Ajax, JavaScript can send a request to the server
●
JavaScript cannot access back-end databases without a
server side script
www.webstackacademy.com ‹#›
JavaScript Limitations
●
JavaScript cannot read from or write to files in the client
– Even though JavaScript is running on the client computer
the one where the web page is being viewed) it is not
allowed to access anything outside of the web page itself
– This is done for reasons of security
●
JavaScript does not have multi-threading
– JavaScript does not have multi-threading capabilities
www.webstackacademy.com ‹#›
●
JavaScript can be implemented using JavaScript
statements that are placed within the <script>... </script>
HTML tags in a web page
JS - first program
<script language="javascript" type="text/javascript">
. . . JavaScript code . . .
</script>
www.webstackacademy.com ‹#›
●
Attributes used in <script> tag
– src
– language (deprecated)
– type
●
Source attribute “src” is used to specify the source JavaScript file
●
Language attribute is used to specify the JavaScript language
●
Type attribute is used to specify that the file type is text file and
contains JavaScript code
JS – HTML script element
www.webstackacademy.com ‹#›
●
“language” attribute is deprecated
●
“type” attribute is needed for old browsers
●
Modern browsers by default assume the language and
type as JavaSctipt, therefore, these attributes are
optional for them
JS – HTML script element
www.webstackacademy.com ‹#›
JS - Internal
<!DOCTYPE html>
<html>
<head>
<script> . . . JS code . . . </script>
</head>
<body>
<script> . . . JS code . . . </script>
</body>
</html>
www.webstackacademy.com ‹#›
JavaScript - Output
Method Description
window.alert() Display data in alert dialog box
document.write() Display data in browser display area
innerHTML() Display data in HTML element
console.log() Display data in browser console
www.webstackacademy.com ‹#›
JS – First Program
<body>
<script>
document.write("Hello JavaScript!!");
</script>
</body>
www.webstackacademy.com ‹#›
JS - External
●
External (or linked script) JavaScript can be inserted using
src attribute
Syntax :
<script src="URL"> </script>
Absolute URL : http://www.example.com/example.js
Relative URL : /script/example.js
www.webstackacademy.com ‹#›
JS - External
Example 1 :
<script src=“script.js”></script>
Example 2 :
<script src=“/js/script.js”></script>
www.webstackacademy.com ‹#›
JS – Linked Script
●
Benefits :
– Decoupling logic from presentation
– Re-use across pages
●
Disadvantage
– Script may load slowly
– Linking to remote script may pose security threat
www.webstackacademy.com ‹#›
JS – HTML nostrictp tag
●
HTML noscript tag contains alternate text to display if
browser does not support JavaScript
<body>
<script> . . . JavaScript code . . . </script>
<noscript> Your browser does not support Javascript!</noscript>
</body>
www.webstackacademy.com ‹#›
Coding Conventions
●
JavaScript Files
– JavaScript programs should be stored in and
delivered as .js files
●
Comments
// Single line comment
/* Multi
* Line comment
*/
www.webstackacademy.com ‹#›
Coding Conventions
●
Variable Names
– Use camelCase for identifier names (variables and
functions)
– The name should be descriptive and concise
– All names start with a letter
– Variable names are case sensitive
www.webstackacademy.com ‹#›
Coding Conventions
●
Naming Conventions
– Variable and function names written as camelCase
– Global variables written in UPPERCASE
– Constants written in UPPERCASE
www.webstackacademy.com ‹#›
Coding Conventions
●
Statement Rule
– Always end a simple statement with a semicolon
– Put the opening bracket at the end of the first line
– Put the closing bracket on a new line, without leading
spaces
– Do not end a complex statement with a semicolon
www.webstackacademy.com ‹#›
References
●
https://www.wikimedia.org/
●
JavaScript , The Complete Reference
(Thomas A.Powell Fritz Schneider)
www.webstackacademy.com ‹#›
Web Stack Academy (P) Ltd
#83, Farah Towers,
1st floor,MG Road,
Bangalore – 560001
M: +91-80-4128 9576
T: +91-98862 69112
E: info@www.webstackacademy.com

More Related Content

PDF
JavaScript - Chapter 4 - Types and Statements
WebStackAcademy
 
PDF
JavaScript - Chapter 5 - Operators
WebStackAcademy
 
PDF
JavaScript - Chapter 15 - Debugging Techniques
WebStackAcademy
 
PDF
JavaScript - Chapter 6 - Basic Functions
WebStackAcademy
 
PPT
Javascript
Manav Prasad
 
PDF
JavaScript - Chapter 12 - Document Object Model
WebStackAcademy
 
PPTX
Resume presentation
Greg Consulta
 
PPTX
Write smart contract with solidity on Ethereum
Murughan Palaniachari
 
JavaScript - Chapter 4 - Types and Statements
WebStackAcademy
 
JavaScript - Chapter 5 - Operators
WebStackAcademy
 
JavaScript - Chapter 15 - Debugging Techniques
WebStackAcademy
 
JavaScript - Chapter 6 - Basic Functions
WebStackAcademy
 
Javascript
Manav Prasad
 
JavaScript - Chapter 12 - Document Object Model
WebStackAcademy
 
Resume presentation
Greg Consulta
 
Write smart contract with solidity on Ethereum
Murughan Palaniachari
 

What's hot (20)

PPTX
Lab #2: Introduction to Javascript
Walid Ashraf
 
PDF
Javascript
Momentum Design Lab
 
PPTX
Java script
Abhishek Kesharwani
 
PPTX
Javascript 101
Shlomi Komemi
 
PDF
Basics of JavaScript
Bala Narayanan
 
PPT
JavaScript - An Introduction
Manvendra Singh
 
PPT
Introduction to Javascript
Amit Tyagi
 
PPTX
Java script
Sadeek Mohammed
 
PPT
JavaScript & Dom Manipulation
Mohammed Arif
 
PPT
Java Script ppt
Priya Goyal
 
PPT
Introduction to JavaScript (1).ppt
MuhammadRehan856177
 
PPT
Javascript arrays
Hassan Dar
 
PDF
Intro to HTML and CSS basics
Eliran Eliassy
 
PPTX
Java script
Shyam Khant
 
PDF
Javascript essentials
Bedis ElAchèche
 
PDF
Basic JavaScript Tutorial
DHTMLExtreme
 
PPTX
Dom
Surinder Kaur
 
PDF
JavaScript - Chapter 11 - Events
WebStackAcademy
 
Lab #2: Introduction to Javascript
Walid Ashraf
 
Java script
Abhishek Kesharwani
 
Javascript 101
Shlomi Komemi
 
Basics of JavaScript
Bala Narayanan
 
JavaScript - An Introduction
Manvendra Singh
 
Introduction to Javascript
Amit Tyagi
 
Java script
Sadeek Mohammed
 
JavaScript & Dom Manipulation
Mohammed Arif
 
Java Script ppt
Priya Goyal
 
Introduction to JavaScript (1).ppt
MuhammadRehan856177
 
Javascript arrays
Hassan Dar
 
Intro to HTML and CSS basics
Eliran Eliassy
 
Java script
Shyam Khant
 
Javascript essentials
Bedis ElAchèche
 
Basic JavaScript Tutorial
DHTMLExtreme
 
JavaScript - Chapter 11 - Events
WebStackAcademy
 
Ad

Similar to JavaScript - Chapter 3 - Introduction (20)

PDF
8.-Javascript-report powerpoint presentation
JohnLagman3
 
PPT
JAVA SCRIPT
Go4Guru
 
PPTX
Introduction to Java script for web .pptx
FahimMousa
 
PPTX
Java script Basic
Jaya Kumari
 
DOC
Java script by Act Academy
actanimation
 
PPT
06 Javascript
Herman Tolle
 
PDF
Always on! Or not?
Carsten Sandtner
 
PDF
CS8651- Unit 2 - JS.internet programming paper anna university -2017 regulation
amrashbhanuabdul
 
PDF
Intro to mobile web application development
zonathen
 
PDF
JS BASICS JAVA SCRIPT SCRIPTING
Arulkumar
 
PPT
Session vii(java scriptbasics)
Shrijan Tiwari
 
PPTX
txWelcome to Javascript Welcome to Javascript.pp
vaibhavdtambe2003
 
PPTX
JavaScript - Getting Started.pptx
JonnJorellPunto
 
PDF
PrairieDevCon 2014 - Web Doesn't Mean Slow
dmethvin
 
PDF
Developing High Performance Web Apps
Timothy Fisher
 
PPTX
Introduction to JQuery, ASP.NET MVC and Silverlight
Peter Gfader
 
PDF
Unit 4(it workshop)
Dr.Lokesh Gagnani
 
PPT
Java script
umesh patil
 
PDF
java-scriptcdvcx vnbm,azsdfghjkml;sxdfcgmndxfcgvhb nmfctgvbhjnm ,cfgvb nm,xc ...
kavigamage62
 
8.-Javascript-report powerpoint presentation
JohnLagman3
 
JAVA SCRIPT
Go4Guru
 
Introduction to Java script for web .pptx
FahimMousa
 
Java script Basic
Jaya Kumari
 
Java script by Act Academy
actanimation
 
06 Javascript
Herman Tolle
 
Always on! Or not?
Carsten Sandtner
 
CS8651- Unit 2 - JS.internet programming paper anna university -2017 regulation
amrashbhanuabdul
 
Intro to mobile web application development
zonathen
 
JS BASICS JAVA SCRIPT SCRIPTING
Arulkumar
 
Session vii(java scriptbasics)
Shrijan Tiwari
 
txWelcome to Javascript Welcome to Javascript.pp
vaibhavdtambe2003
 
JavaScript - Getting Started.pptx
JonnJorellPunto
 
PrairieDevCon 2014 - Web Doesn't Mean Slow
dmethvin
 
Developing High Performance Web Apps
Timothy Fisher
 
Introduction to JQuery, ASP.NET MVC and Silverlight
Peter Gfader
 
Unit 4(it workshop)
Dr.Lokesh Gagnani
 
Java script
umesh patil
 
java-scriptcdvcx vnbm,azsdfghjkml;sxdfcgmndxfcgvhb nmfctgvbhjnm ,cfgvb nm,xc ...
kavigamage62
 
Ad

More from WebStackAcademy (20)

PDF
Webstack Academy - Course Demo Webinar and Placement Journey
WebStackAcademy
 
PDF
WSA: Scaling Web Service to Handle Millions of Requests per Second
WebStackAcademy
 
PDF
WSA: Course Demo Webinar - Full Stack Developer Course
WebStackAcademy
 
PDF
Career Building in AI - Technologies, Trends and Opportunities
WebStackAcademy
 
PDF
Webstack Academy - Internship Kick Off
WebStackAcademy
 
PDF
Building Your Online Portfolio
WebStackAcademy
 
PDF
Front-End Developer's Career Roadmap
WebStackAcademy
 
PDF
Angular - Chapter 9 - Authentication and Authorization
WebStackAcademy
 
PDF
Angular - Chapter 7 - HTTP Services
WebStackAcademy
 
PDF
Angular - Chapter 6 - Firebase Integration
WebStackAcademy
 
PDF
Angular - Chapter 5 - Directives
WebStackAcademy
 
PDF
Angular - Chapter 4 - Data and Event Handling
WebStackAcademy
 
PDF
Angular - Chapter 3 - Components
WebStackAcademy
 
PDF
Angular - Chapter 2 - TypeScript Programming
WebStackAcademy
 
PDF
Angular - Chapter 1 - Introduction
WebStackAcademy
 
PDF
JavaScript - Chapter 10 - Strings and Arrays
WebStackAcademy
 
PDF
JavaScript - Chapter 14 - Form Handling
WebStackAcademy
 
PDF
JavaScript - Chapter 13 - Browser Object Model(BOM)
WebStackAcademy
 
PDF
JavaScript - Chapter 9 - TypeConversion and Regular Expressions
WebStackAcademy
 
PDF
JavaScript - Chapter 8 - Objects
WebStackAcademy
 
Webstack Academy - Course Demo Webinar and Placement Journey
WebStackAcademy
 
WSA: Scaling Web Service to Handle Millions of Requests per Second
WebStackAcademy
 
WSA: Course Demo Webinar - Full Stack Developer Course
WebStackAcademy
 
Career Building in AI - Technologies, Trends and Opportunities
WebStackAcademy
 
Webstack Academy - Internship Kick Off
WebStackAcademy
 
Building Your Online Portfolio
WebStackAcademy
 
Front-End Developer's Career Roadmap
WebStackAcademy
 
Angular - Chapter 9 - Authentication and Authorization
WebStackAcademy
 
Angular - Chapter 7 - HTTP Services
WebStackAcademy
 
Angular - Chapter 6 - Firebase Integration
WebStackAcademy
 
Angular - Chapter 5 - Directives
WebStackAcademy
 
Angular - Chapter 4 - Data and Event Handling
WebStackAcademy
 
Angular - Chapter 3 - Components
WebStackAcademy
 
Angular - Chapter 2 - TypeScript Programming
WebStackAcademy
 
Angular - Chapter 1 - Introduction
WebStackAcademy
 
JavaScript - Chapter 10 - Strings and Arrays
WebStackAcademy
 
JavaScript - Chapter 14 - Form Handling
WebStackAcademy
 
JavaScript - Chapter 13 - Browser Object Model(BOM)
WebStackAcademy
 
JavaScript - Chapter 9 - TypeConversion and Regular Expressions
WebStackAcademy
 
JavaScript - Chapter 8 - Objects
WebStackAcademy
 

Recently uploaded (20)

PDF
DevOps & Developer Experience Summer BBQ
AUGNYC
 
PDF
Why Your AI & Cybersecurity Hiring Still Misses the Mark in 2025
Virtual Employee Pvt. Ltd.
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PPTX
How to Build a Scalable Micro-Investing Platform in 2025 - A Founder’s Guide ...
Third Rock Techkno
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PPTX
The Power of IoT Sensor Integration in Smart Infrastructure and Automation.pptx
Rejig Digital
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PPTX
ChatGPT's Deck on The Enduring Legacy of Fax Machines
Greg Swan
 
PDF
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
PDF
Shreyas_Phanse_Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
SHREYAS PHANSE
 
PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
AbdullahSani29
 
PDF
Doc9.....................................
SofiaCollazos
 
PDF
Revolutionize Operations with Intelligent IoT Monitoring and Control
Rejig Digital
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
PDF
agentic-ai-and-the-future-of-autonomous-systems.pdf
siddharthnetsavvies
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PDF
Building High-Performance Oracle Teams: Strategic Staffing for Database Manag...
SMACT Works
 
PDF
CIFDAQ's Teaching Thursday: Moving Averages Made Simple
CIFDAQ
 
DevOps & Developer Experience Summer BBQ
AUGNYC
 
Why Your AI & Cybersecurity Hiring Still Misses the Mark in 2025
Virtual Employee Pvt. Ltd.
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
How to Build a Scalable Micro-Investing Platform in 2025 - A Founder’s Guide ...
Third Rock Techkno
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
The Power of IoT Sensor Integration in Smart Infrastructure and Automation.pptx
Rejig Digital
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
ChatGPT's Deck on The Enduring Legacy of Fax Machines
Greg Swan
 
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
Shreyas_Phanse_Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
SHREYAS PHANSE
 
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
AbdullahSani29
 
Doc9.....................................
SofiaCollazos
 
Revolutionize Operations with Intelligent IoT Monitoring and Control
Rejig Digital
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
agentic-ai-and-the-future-of-autonomous-systems.pdf
siddharthnetsavvies
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
Building High-Performance Oracle Teams: Strategic Staffing for Database Manag...
SMACT Works
 
CIFDAQ's Teaching Thursday: Moving Averages Made Simple
CIFDAQ
 

JavaScript - Chapter 3 - Introduction