SlideShare a Scribd company logo
JavaScript
Aparna U
Assistant Professor
Department of Vocational Studies
St. Mary’s College, Thrissur
JavaScript,Aparna U,St.Mary’s College
JAVASCRIPT: Introduction
 A lightweight programming language ("scripting language")
It is used to make web pages interactive
Insert dynamic text into HTML (ex: user name)
React to events (ex: page load user click)
Get information about a user's computer (ex: browser type)
Perform calculations on user's computer (ex: form validation)
JavaScript,Aparna U,St.Mary’s College
Brendan Eich(1995)
NetScape recruited Brendan Eich with the
goal of Scheme Programming Language
into its NetScape Navigator
JavaScript,Aparna U,St.Mary’s College
Benefits of JavaScript
 To put things simply, JavaScript is an object orient programming
language designed to make web development easier and more
attractive.
 JavaScript is used to create responsive, interactive elements for web
pages, enhancing the user experience.
 It can modify a page without having to post back to the server (faster
UI)
 It can make small, quick changes to page without waiting
 It can respond to user actions like clicks and key presses
JavaScript,Aparna U,St.Mar’ys College
Why JS?
The importance of JavaScript as a web technology can be
determined from the fact that it is currently used by 94.5% of all
websites.
 As a client-side programming language, JavaScript helps web
developers to make web pages dynamic and interactive by
implementing custom client-side scripts.
JavaScript,Aparna U,St.Mary’s College
Do Java and JavaSript Differ?
Java is an OOP programming language while Java Script is an OOP
scripting language.
Java creates applications that run in a virtual machine or browser while
JavaScript code is run on a browser only.
Java code needs to be compiled while JavaScript code are all in text.
JavaScript,Aparna U,St.Mar’ys College
JS POP-UP BOXES
There are three different Pop up boxes in JS
 Alert Boxes
 Confirm Boxes
 Prompt Boxes
JavaScript,Aparna U,St.Mary’s College
 An alert box is often used if you want to make sure information
comes through to the user.
 When an alert box pops up, the user will have to click "OK" to
proceed.
Here is the simple example to display a text in alert box
<script type”text/javascript”>
alert(“This is an alertbox”);
</script>
Alert Box
JavaScript,Aparna U,St.Mar’ys College
A confirm box is often used if you want the user to verify or accept
something
When a confirm box pops up, the user will have to click either "OK" or
"Cancel" to proceed. Here is the example for confirm box.
<script type="text/javascript">
mess1='Press Ok to Continue.';
x = confirm(mess1);
if (x == true){
alert("You have clicked on Ok Button.");}
else{
alert("You have clicked on Cancel Button."); }
</script>
Confirm Box
JavaScript,Aparna U,St.Mar’ys College
A prompt box is often used if you want the user to input a value
before entering a page.
When a prompt box pops up, the user will have to click either "OK"
or "Cancel" to proceed after entering an input value.
If the user clicks "OK“, the box returns the input value. If the user
clicks "Cancel“, the box returns null. Here is the example for
prompt box.
<script>
var person = prompt("Please enter your name", "Harry Potter");
if (person == null || person == "") {
txt = "User cancelled the prompt.";
} else {
txt = "Hello " + person + "! How are you today?";}
</script>
Prompt Box

More Related Content

Similar to Computer Science:JavaScript (20)

PPTX
JavaScript Training in Ambala ! Batra Computer Centre
jatin batra
 
PPTX
Web designing unit 4
Dr. SURBHI SAROHA
 
PDF
CS8651- Unit 2 - JS.internet programming paper anna university -2017 regulation
amrashbhanuabdul
 
PPTX
HNDIT1022 Week 08, 09 10 Theory web .pptx
IsuriUmayangana
 
PPTX
Introduction to JAVA SCRIPT USING HTML and CSS
ManasaMR2
 
PPTX
JavaScript New Tutorial Class XI and XII.pptx
rish15r890
 
PPTX
Java script
Sukrit Gupta
 
PPTX
Basics of Javascript
poojanov04
 
PPTX
Jscript part1
Girish Srivastava
 
PPTX
Java script introduction
Jesus Obenita Jr.
 
PPTX
Java script
Rajkiran Mummadi
 
PPTX
Javascript 01 (js)
AbhishekMondal42
 
PDF
java-scriptcdvcx vnbm,azsdfghjkml;sxdfcgmndxfcgvhb nmfctgvbhjnm ,cfgvb nm,xc ...
kavigamage62
 
PPTX
BITM3730 10-17.pptx
MattMarino13
 
PPTX
An Introduction to JavaScript
tonyh1
 
PPTX
Final Java-script.pptx
AlkanthiSomesh
 
PPTX
javascript.pptx
Muthuganesh S
 
PPTX
Javascript
Nagarajan
 
PPT
FSJavaScript.ppt
AbhishekKumar66407
 
JavaScript Training in Ambala ! Batra Computer Centre
jatin batra
 
Web designing unit 4
Dr. SURBHI SAROHA
 
CS8651- Unit 2 - JS.internet programming paper anna university -2017 regulation
amrashbhanuabdul
 
HNDIT1022 Week 08, 09 10 Theory web .pptx
IsuriUmayangana
 
Introduction to JAVA SCRIPT USING HTML and CSS
ManasaMR2
 
JavaScript New Tutorial Class XI and XII.pptx
rish15r890
 
Java script
Sukrit Gupta
 
Basics of Javascript
poojanov04
 
Jscript part1
Girish Srivastava
 
Java script introduction
Jesus Obenita Jr.
 
Java script
Rajkiran Mummadi
 
Javascript 01 (js)
AbhishekMondal42
 
java-scriptcdvcx vnbm,azsdfghjkml;sxdfcgmndxfcgvhb nmfctgvbhjnm ,cfgvb nm,xc ...
kavigamage62
 
BITM3730 10-17.pptx
MattMarino13
 
An Introduction to JavaScript
tonyh1
 
Final Java-script.pptx
AlkanthiSomesh
 
javascript.pptx
Muthuganesh S
 
Javascript
Nagarajan
 
FSJavaScript.ppt
AbhishekKumar66407
 

More from St Mary's College,Thrissur,Kerala (20)

PPTX
Creative writing and literature
St Mary's College,Thrissur,Kerala
 
PPTX
Online Data Storage
St Mary's College,Thrissur,Kerala
 
PPTX
Mathematics:Cryptography
St Mary's College,Thrissur,Kerala
 
PPTX
Mathematics:Arithmetical Functions
St Mary's College,Thrissur,Kerala
 
PPTX
Physical education :Yoga For Stress Relief
St Mary's College,Thrissur,Kerala
 
PPTX
Psychology:PAIN: Types, Theories and Assessment of pain
St Mary's College,Thrissur,Kerala
 
PPTX
Economics:Functions
St Mary's College,Thrissur,Kerala
 
PPTX
Mathematics:H-Complexity
St Mary's College,Thrissur,Kerala
 
PPTX
Statistics:Probability Theory
St Mary's College,Thrissur,Kerala
 
PPTX
Statistics:Fundamentals Of Statistics
St Mary's College,Thrissur,Kerala
 
PPTX
Economics:Public Revenue
St Mary's College,Thrissur,Kerala
 
PPTX
Economics:Public Debt
St Mary's College,Thrissur,Kerala
 
PPTX
Economics:Poverty-perspectives And Dimensions
St Mary's College,Thrissur,Kerala
 
PPTX
Economics:Economic Integration
St Mary's College,Thrissur,Kerala
 
PPTX
Economics:Enviornmental Pollution
St Mary's College,Thrissur,Kerala
 
PPTX
Computer Science:Sql Set Operation
St Mary's College,Thrissur,Kerala
 
PPTX
Computer Science:Java jdbc
St Mary's College,Thrissur,Kerala
 
PPTX
Microbiology:General Principles of Food Preservation
St Mary's College,Thrissur,Kerala
 
PPTX
Microbiology:Induction Course-Introduction to Medical Microbiology
St Mary's College,Thrissur,Kerala
 
Creative writing and literature
St Mary's College,Thrissur,Kerala
 
Mathematics:Cryptography
St Mary's College,Thrissur,Kerala
 
Mathematics:Arithmetical Functions
St Mary's College,Thrissur,Kerala
 
Physical education :Yoga For Stress Relief
St Mary's College,Thrissur,Kerala
 
Psychology:PAIN: Types, Theories and Assessment of pain
St Mary's College,Thrissur,Kerala
 
Mathematics:H-Complexity
St Mary's College,Thrissur,Kerala
 
Statistics:Probability Theory
St Mary's College,Thrissur,Kerala
 
Statistics:Fundamentals Of Statistics
St Mary's College,Thrissur,Kerala
 
Economics:Public Revenue
St Mary's College,Thrissur,Kerala
 
Economics:Public Debt
St Mary's College,Thrissur,Kerala
 
Economics:Poverty-perspectives And Dimensions
St Mary's College,Thrissur,Kerala
 
Economics:Economic Integration
St Mary's College,Thrissur,Kerala
 
Economics:Enviornmental Pollution
St Mary's College,Thrissur,Kerala
 
Computer Science:Sql Set Operation
St Mary's College,Thrissur,Kerala
 
Computer Science:Java jdbc
St Mary's College,Thrissur,Kerala
 
Microbiology:General Principles of Food Preservation
St Mary's College,Thrissur,Kerala
 
Microbiology:Induction Course-Introduction to Medical Microbiology
St Mary's College,Thrissur,Kerala
 
Ad

Recently uploaded (20)

PPTX
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
PDF
CEREBRAL PALSY: NURSING MANAGEMENT .pdf
PRADEEP ABOTHU
 
PPTX
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
PPTX
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
PPTX
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
PDF
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
PDF
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 
PDF
LAW OF CONTRACT ( 5 YEAR LLB & UNITARY LLB)- MODULE-3 - LEARN THROUGH PICTURE
APARNA T SHAIL KUMAR
 
PDF
The Different Types of Non-Experimental Research
Thelma Villaflores
 
PDF
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
PDF
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - GLOBAL SUCCESS - CẢ NĂM - NĂM 2024 (VOCABULARY, ...
Nguyen Thanh Tu Collection
 
PPTX
HYDROCEPHALUS: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
PDF
The-Ever-Evolving-World-of-Science (1).pdf/7TH CLASS CURIOSITY /1ST CHAPTER/B...
Sandeep Swamy
 
PPTX
MENINGITIS: NURSING MANAGEMENT, BACTERIAL MENINGITIS, VIRAL MENINGITIS.pptx
PRADEEP ABOTHU
 
PPTX
Soil and agriculture microbiology .pptx
Keerthana Ramesh
 
PDF
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
PPTX
How to Create a PDF Report in Odoo 18 - Odoo Slides
Celine George
 
PPTX
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
PDF
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
PDF
SSHS-2025-PKLP_Quarter-1-Dr.-Kerby-Alvarez.pdf
AishahSangcopan1
 
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
CEREBRAL PALSY: NURSING MANAGEMENT .pdf
PRADEEP ABOTHU
 
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 
LAW OF CONTRACT ( 5 YEAR LLB & UNITARY LLB)- MODULE-3 - LEARN THROUGH PICTURE
APARNA T SHAIL KUMAR
 
The Different Types of Non-Experimental Research
Thelma Villaflores
 
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - GLOBAL SUCCESS - CẢ NĂM - NĂM 2024 (VOCABULARY, ...
Nguyen Thanh Tu Collection
 
HYDROCEPHALUS: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
The-Ever-Evolving-World-of-Science (1).pdf/7TH CLASS CURIOSITY /1ST CHAPTER/B...
Sandeep Swamy
 
MENINGITIS: NURSING MANAGEMENT, BACTERIAL MENINGITIS, VIRAL MENINGITIS.pptx
PRADEEP ABOTHU
 
Soil and agriculture microbiology .pptx
Keerthana Ramesh
 
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
How to Create a PDF Report in Odoo 18 - Odoo Slides
Celine George
 
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
SSHS-2025-PKLP_Quarter-1-Dr.-Kerby-Alvarez.pdf
AishahSangcopan1
 
Ad

Computer Science:JavaScript

  • 1. JavaScript Aparna U Assistant Professor Department of Vocational Studies St. Mary’s College, Thrissur
  • 2. JavaScript,Aparna U,St.Mary’s College JAVASCRIPT: Introduction  A lightweight programming language ("scripting language") It is used to make web pages interactive Insert dynamic text into HTML (ex: user name) React to events (ex: page load user click) Get information about a user's computer (ex: browser type) Perform calculations on user's computer (ex: form validation)
  • 3. JavaScript,Aparna U,St.Mary’s College Brendan Eich(1995) NetScape recruited Brendan Eich with the goal of Scheme Programming Language into its NetScape Navigator
  • 4. JavaScript,Aparna U,St.Mary’s College Benefits of JavaScript  To put things simply, JavaScript is an object orient programming language designed to make web development easier and more attractive.  JavaScript is used to create responsive, interactive elements for web pages, enhancing the user experience.  It can modify a page without having to post back to the server (faster UI)  It can make small, quick changes to page without waiting  It can respond to user actions like clicks and key presses
  • 5. JavaScript,Aparna U,St.Mar’ys College Why JS? The importance of JavaScript as a web technology can be determined from the fact that it is currently used by 94.5% of all websites.  As a client-side programming language, JavaScript helps web developers to make web pages dynamic and interactive by implementing custom client-side scripts.
  • 6. JavaScript,Aparna U,St.Mary’s College Do Java and JavaSript Differ? Java is an OOP programming language while Java Script is an OOP scripting language. Java creates applications that run in a virtual machine or browser while JavaScript code is run on a browser only. Java code needs to be compiled while JavaScript code are all in text.
  • 7. JavaScript,Aparna U,St.Mar’ys College JS POP-UP BOXES There are three different Pop up boxes in JS  Alert Boxes  Confirm Boxes  Prompt Boxes
  • 8. JavaScript,Aparna U,St.Mary’s College  An alert box is often used if you want to make sure information comes through to the user.  When an alert box pops up, the user will have to click "OK" to proceed. Here is the simple example to display a text in alert box <script type”text/javascript”> alert(“This is an alertbox”); </script> Alert Box
  • 9. JavaScript,Aparna U,St.Mar’ys College A confirm box is often used if you want the user to verify or accept something When a confirm box pops up, the user will have to click either "OK" or "Cancel" to proceed. Here is the example for confirm box. <script type="text/javascript"> mess1='Press Ok to Continue.'; x = confirm(mess1); if (x == true){ alert("You have clicked on Ok Button.");} else{ alert("You have clicked on Cancel Button."); } </script> Confirm Box
  • 10. JavaScript,Aparna U,St.Mar’ys College A prompt box is often used if you want the user to input a value before entering a page. When a prompt box pops up, the user will have to click either "OK" or "Cancel" to proceed after entering an input value. If the user clicks "OK“, the box returns the input value. If the user clicks "Cancel“, the box returns null. Here is the example for prompt box. <script> var person = prompt("Please enter your name", "Harry Potter"); if (person == null || person == "") { txt = "User cancelled the prompt."; } else { txt = "Hello " + person + "! How are you today?";} </script> Prompt Box