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
Ad

More Related Content

Similar to Computer Science:JavaScript (20)

JAVA SCRIPT
JAVA SCRIPTJAVA SCRIPT
JAVA SCRIPT
Mohammed Hussein
 
wp-UNIT_III.pptx
wp-UNIT_III.pptxwp-UNIT_III.pptx
wp-UNIT_III.pptx
GANDHAMKUMAR2
 
Reacting to a Virtual World
Reacting to a Virtual WorldReacting to a Virtual World
Reacting to a Virtual World
Jaime Christine Perez
 
internet Chapter 4-JavascripPrepare a ppt of video compression techniques bas...
internet Chapter 4-JavascripPrepare a ppt of video compression techniques bas...internet Chapter 4-JavascripPrepare a ppt of video compression techniques bas...
internet Chapter 4-JavascripPrepare a ppt of video compression techniques bas...
wabii3179com
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascript
ambuj pathak
 
4007655 introduction-to-javascript
4007655 introduction-to-javascript4007655 introduction-to-javascript
4007655 introduction-to-javascript
Vikash Chandra
 
Message Box in JS
Message Box in JSMessage Box in JS
Message Box in JS
paranormal2013
 
Unit III.pptx IT3401 web essentials presentatio
Unit III.pptx IT3401 web essentials presentatioUnit III.pptx IT3401 web essentials presentatio
Unit III.pptx IT3401 web essentials presentatio
lakshitakumar291
 
Brief Introduction on JavaScript - Internship Presentation - Week4
Brief Introduction on JavaScript - Internship Presentation - Week4Brief Introduction on JavaScript - Internship Presentation - Week4
Brief Introduction on JavaScript - Internship Presentation - Week4
Devang Garach
 
Active browser web page
Active browser web pageActive browser web page
Active browser web page
Zee1481
 
JavaScript with Syntax & Implementation
JavaScript with Syntax & ImplementationJavaScript with Syntax & Implementation
JavaScript with Syntax & Implementation
Soumen Santra
 
Lecture 6 Footnotes&amp; Answers
Lecture 6  Footnotes&amp; AnswersLecture 6  Footnotes&amp; Answers
Lecture 6 Footnotes&amp; Answers
is4030.ray
 
Basic Java script handouts for students
Basic Java script handouts for students Basic Java script handouts for students
Basic Java script handouts for students
shafiq sangi
 
JAVASRIPT and PHP (Hypertext Preprocessor)
JAVASRIPT and PHP (Hypertext Preprocessor)JAVASRIPT and PHP (Hypertext Preprocessor)
JAVASRIPT and PHP (Hypertext Preprocessor)
shelakenitinit
 
JavaScript New Tutorial Class XI and XII.pptx
JavaScript New Tutorial Class XI and XII.pptxJavaScript New Tutorial Class XI and XII.pptx
JavaScript New Tutorial Class XI and XII.pptx
rish15r890
 
8.-Javascript-report powerpoint presentation
8.-Javascript-report powerpoint presentation8.-Javascript-report powerpoint presentation
8.-Javascript-report powerpoint presentation
JohnLagman3
 
Java script Basic
Java script BasicJava script Basic
Java script Basic
Jaya Kumari
 
Basics java scripts
Basics java scriptsBasics java scripts
Basics java scripts
ch samaram
 
Unit 4(it workshop)
Unit 4(it workshop)Unit 4(it workshop)
Unit 4(it workshop)
Dr.Lokesh Gagnani
 
Java script
Java scriptJava script
Java script
Rajkiran Mummadi
 
internet Chapter 4-JavascripPrepare a ppt of video compression techniques bas...
internet Chapter 4-JavascripPrepare a ppt of video compression techniques bas...internet Chapter 4-JavascripPrepare a ppt of video compression techniques bas...
internet Chapter 4-JavascripPrepare a ppt of video compression techniques bas...
wabii3179com
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascript
ambuj pathak
 
4007655 introduction-to-javascript
4007655 introduction-to-javascript4007655 introduction-to-javascript
4007655 introduction-to-javascript
Vikash Chandra
 
Unit III.pptx IT3401 web essentials presentatio
Unit III.pptx IT3401 web essentials presentatioUnit III.pptx IT3401 web essentials presentatio
Unit III.pptx IT3401 web essentials presentatio
lakshitakumar291
 
Brief Introduction on JavaScript - Internship Presentation - Week4
Brief Introduction on JavaScript - Internship Presentation - Week4Brief Introduction on JavaScript - Internship Presentation - Week4
Brief Introduction on JavaScript - Internship Presentation - Week4
Devang Garach
 
Active browser web page
Active browser web pageActive browser web page
Active browser web page
Zee1481
 
JavaScript with Syntax & Implementation
JavaScript with Syntax & ImplementationJavaScript with Syntax & Implementation
JavaScript with Syntax & Implementation
Soumen Santra
 
Lecture 6 Footnotes&amp; Answers
Lecture 6  Footnotes&amp; AnswersLecture 6  Footnotes&amp; Answers
Lecture 6 Footnotes&amp; Answers
is4030.ray
 
Basic Java script handouts for students
Basic Java script handouts for students Basic Java script handouts for students
Basic Java script handouts for students
shafiq sangi
 
JAVASRIPT and PHP (Hypertext Preprocessor)
JAVASRIPT and PHP (Hypertext Preprocessor)JAVASRIPT and PHP (Hypertext Preprocessor)
JAVASRIPT and PHP (Hypertext Preprocessor)
shelakenitinit
 
JavaScript New Tutorial Class XI and XII.pptx
JavaScript New Tutorial Class XI and XII.pptxJavaScript New Tutorial Class XI and XII.pptx
JavaScript New Tutorial Class XI and XII.pptx
rish15r890
 
8.-Javascript-report powerpoint presentation
8.-Javascript-report powerpoint presentation8.-Javascript-report powerpoint presentation
8.-Javascript-report powerpoint presentation
JohnLagman3
 
Java script Basic
Java script BasicJava script Basic
Java script Basic
Jaya Kumari
 
Basics java scripts
Basics java scriptsBasics java scripts
Basics java scripts
ch samaram
 

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

Creative writing and literature
Creative writing and literature Creative writing and literature
Creative writing and literature
St Mary's College,Thrissur,Kerala
 
Magnetic Tape
Magnetic TapeMagnetic Tape
Magnetic Tape
St Mary's College,Thrissur,Kerala
 
Online Data Storage
Online Data StorageOnline Data Storage
Online Data Storage
St Mary's College,Thrissur,Kerala
 
Mathematics:Cryptography
Mathematics:CryptographyMathematics:Cryptography
Mathematics:Cryptography
St Mary's College,Thrissur,Kerala
 
Mathematics:Arithmetical Functions
Mathematics:Arithmetical FunctionsMathematics:Arithmetical Functions
Mathematics:Arithmetical Functions
St Mary's College,Thrissur,Kerala
 
Physical education :Yoga For Stress Relief
Physical education :Yoga For Stress ReliefPhysical education :Yoga For Stress Relief
Physical education :Yoga For Stress Relief
St Mary's College,Thrissur,Kerala
 
Psychology:PAIN: Types, Theories and Assessment of pain
Psychology:PAIN: Types, Theories and  Assessment of pain Psychology:PAIN: Types, Theories and  Assessment of pain
Psychology:PAIN: Types, Theories and Assessment of pain
St Mary's College,Thrissur,Kerala
 
Economics:Functions
Economics:FunctionsEconomics:Functions
Economics:Functions
St Mary's College,Thrissur,Kerala
 
Mathematics:H-Complexity
Mathematics:H-ComplexityMathematics:H-Complexity
Mathematics:H-Complexity
St Mary's College,Thrissur,Kerala
 
Statistics:Probability Theory
Statistics:Probability TheoryStatistics:Probability Theory
Statistics:Probability Theory
St Mary's College,Thrissur,Kerala
 
Statistics:Fundamentals Of Statistics
Statistics:Fundamentals Of StatisticsStatistics:Fundamentals Of Statistics
Statistics:Fundamentals Of Statistics
St Mary's College,Thrissur,Kerala
 
Economics:Public Revenue
Economics:Public RevenueEconomics:Public Revenue
Economics:Public Revenue
St Mary's College,Thrissur,Kerala
 
Economics:Public Debt
Economics:Public  DebtEconomics:Public  Debt
Economics:Public Debt
St Mary's College,Thrissur,Kerala
 
Economics:Poverty-perspectives And Dimensions
Economics:Poverty-perspectives And DimensionsEconomics:Poverty-perspectives And Dimensions
Economics:Poverty-perspectives And Dimensions
St Mary's College,Thrissur,Kerala
 
Economics:Economic Integration
Economics:Economic IntegrationEconomics:Economic Integration
Economics:Economic Integration
St Mary's College,Thrissur,Kerala
 
Economics:Enviornmental Pollution
Economics:Enviornmental Pollution Economics:Enviornmental Pollution
Economics:Enviornmental Pollution
St Mary's College,Thrissur,Kerala
 
Computer Science:Sql Set Operation
Computer Science:Sql Set OperationComputer Science:Sql Set Operation
Computer Science:Sql Set Operation
St Mary's College,Thrissur,Kerala
 
Computer Science:Java jdbc
Computer Science:Java jdbcComputer Science:Java jdbc
Computer Science:Java jdbc
St Mary's College,Thrissur,Kerala
 
Microbiology:General Principles of Food Preservation
Microbiology:General Principles of Food PreservationMicrobiology:General Principles of Food Preservation
Microbiology:General Principles of Food Preservation
St Mary's College,Thrissur,Kerala
 
Microbiology:Induction Course-Introduction to Medical Microbiology
Microbiology:Induction Course-Introduction to Medical MicrobiologyMicrobiology:Induction Course-Introduction to Medical Microbiology
Microbiology:Induction Course-Introduction to Medical Microbiology
St Mary's College,Thrissur,Kerala
 
Microbiology:Induction Course-Introduction to Medical Microbiology
Microbiology:Induction Course-Introduction to Medical MicrobiologyMicrobiology:Induction Course-Introduction to Medical Microbiology
Microbiology:Induction Course-Introduction to Medical Microbiology
St Mary's College,Thrissur,Kerala
 
Ad

Recently uploaded (20)

SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptxSCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
Ronisha Das
 
Ranking_Felicidade_2024_com_Educacao_Marketing Educacional_V2.pdf
Ranking_Felicidade_2024_com_Educacao_Marketing Educacional_V2.pdfRanking_Felicidade_2024_com_Educacao_Marketing Educacional_V2.pdf
Ranking_Felicidade_2024_com_Educacao_Marketing Educacional_V2.pdf
Rafael Villas B
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
Tax evasion, Tax planning & Tax avoidance.pptx
Tax evasion, Tax  planning &  Tax avoidance.pptxTax evasion, Tax  planning &  Tax avoidance.pptx
Tax evasion, Tax planning & Tax avoidance.pptx
manishbaidya2017
 
Form View Attributes in Odoo 18 - Odoo Slides
Form View Attributes in Odoo 18 - Odoo SlidesForm View Attributes in Odoo 18 - Odoo Slides
Form View Attributes in Odoo 18 - Odoo Slides
Celine George
 
How to Manage Purchase Alternatives in Odoo 18
How to Manage Purchase Alternatives in Odoo 18How to Manage Purchase Alternatives in Odoo 18
How to Manage Purchase Alternatives in Odoo 18
Celine George
 
How to Configure Public Holidays & Mandatory Days in Odoo 18
How to Configure Public Holidays & Mandatory Days in Odoo 18How to Configure Public Holidays & Mandatory Days in Odoo 18
How to Configure Public Holidays & Mandatory Days in Odoo 18
Celine George
 
Sugar-Sensing Mechanism in plants....pptx
Sugar-Sensing Mechanism in plants....pptxSugar-Sensing Mechanism in plants....pptx
Sugar-Sensing Mechanism in plants....pptx
Dr. Renu Jangid
 
Grade 2 - Mathematics - Printable Worksheet
Grade 2 - Mathematics - Printable WorksheetGrade 2 - Mathematics - Printable Worksheet
Grade 2 - Mathematics - Printable Worksheet
Sritoma Majumder
 
Drive Supporter Growth from Awareness to Advocacy with TechSoup Marketing Ser...
Drive Supporter Growth from Awareness to Advocacy with TechSoup Marketing Ser...Drive Supporter Growth from Awareness to Advocacy with TechSoup Marketing Ser...
Drive Supporter Growth from Awareness to Advocacy with TechSoup Marketing Ser...
TechSoup
 
APM Midlands Region April 2025 Sacha Hind Circulated.pdf
APM Midlands Region April 2025 Sacha Hind Circulated.pdfAPM Midlands Region April 2025 Sacha Hind Circulated.pdf
APM Midlands Region April 2025 Sacha Hind Circulated.pdf
Association for Project Management
 
How to Configure Scheduled Actions in odoo 18
How to Configure Scheduled Actions in odoo 18How to Configure Scheduled Actions in odoo 18
How to Configure Scheduled Actions in odoo 18
Celine George
 
BỘ ĐỀ TUYỂN SINH VÀO LỚP 10 TIẾNG ANH - 25 ĐỀ THI BÁM SÁT CẤU TRÚC MỚI NHẤT, ...
BỘ ĐỀ TUYỂN SINH VÀO LỚP 10 TIẾNG ANH - 25 ĐỀ THI BÁM SÁT CẤU TRÚC MỚI NHẤT, ...BỘ ĐỀ TUYỂN SINH VÀO LỚP 10 TIẾNG ANH - 25 ĐỀ THI BÁM SÁT CẤU TRÚC MỚI NHẤT, ...
BỘ ĐỀ TUYỂN SINH VÀO LỚP 10 TIẾNG ANH - 25 ĐỀ THI BÁM SÁT CẤU TRÚC MỚI NHẤT, ...
Nguyen Thanh Tu Collection
 
Bridging the Transit Gap: Equity Drive Feeder Bus Design for Southeast Brooklyn
Bridging the Transit Gap: Equity Drive Feeder Bus Design for Southeast BrooklynBridging the Transit Gap: Equity Drive Feeder Bus Design for Southeast Brooklyn
Bridging the Transit Gap: Equity Drive Feeder Bus Design for Southeast Brooklyn
i4jd41bk
 
Lecture 2 CLASSIFICATION OF PHYLUM ARTHROPODA UPTO CLASSES & POSITION OF_1.pptx
Lecture 2 CLASSIFICATION OF PHYLUM ARTHROPODA UPTO CLASSES & POSITION OF_1.pptxLecture 2 CLASSIFICATION OF PHYLUM ARTHROPODA UPTO CLASSES & POSITION OF_1.pptx
Lecture 2 CLASSIFICATION OF PHYLUM ARTHROPODA UPTO CLASSES & POSITION OF_1.pptx
Arshad Shaikh
 
LDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDMMIA Reiki News Ed3 Vol1 For Team and GuestsLDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDM Mia eStudios
 
How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 
Lecture 4 INSECT CUTICLE and moulting.pptx
Lecture 4 INSECT CUTICLE and moulting.pptxLecture 4 INSECT CUTICLE and moulting.pptx
Lecture 4 INSECT CUTICLE and moulting.pptx
Arshad Shaikh
 
Ancient Stone Sculptures of India: As a Source of Indian History
Ancient Stone Sculptures of India: As a Source of Indian HistoryAncient Stone Sculptures of India: As a Source of Indian History
Ancient Stone Sculptures of India: As a Source of Indian History
Virag Sontakke
 
APGAR SCORE BY sweety Tamanna Mahapatra MSc Pediatric
APGAR SCORE  BY sweety Tamanna Mahapatra MSc PediatricAPGAR SCORE  BY sweety Tamanna Mahapatra MSc Pediatric
APGAR SCORE BY sweety Tamanna Mahapatra MSc Pediatric
SweetytamannaMohapat
 
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptxSCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
Ronisha Das
 
Ranking_Felicidade_2024_com_Educacao_Marketing Educacional_V2.pdf
Ranking_Felicidade_2024_com_Educacao_Marketing Educacional_V2.pdfRanking_Felicidade_2024_com_Educacao_Marketing Educacional_V2.pdf
Ranking_Felicidade_2024_com_Educacao_Marketing Educacional_V2.pdf
Rafael Villas B
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
Tax evasion, Tax planning & Tax avoidance.pptx
Tax evasion, Tax  planning &  Tax avoidance.pptxTax evasion, Tax  planning &  Tax avoidance.pptx
Tax evasion, Tax planning & Tax avoidance.pptx
manishbaidya2017
 
Form View Attributes in Odoo 18 - Odoo Slides
Form View Attributes in Odoo 18 - Odoo SlidesForm View Attributes in Odoo 18 - Odoo Slides
Form View Attributes in Odoo 18 - Odoo Slides
Celine George
 
How to Manage Purchase Alternatives in Odoo 18
How to Manage Purchase Alternatives in Odoo 18How to Manage Purchase Alternatives in Odoo 18
How to Manage Purchase Alternatives in Odoo 18
Celine George
 
How to Configure Public Holidays & Mandatory Days in Odoo 18
How to Configure Public Holidays & Mandatory Days in Odoo 18How to Configure Public Holidays & Mandatory Days in Odoo 18
How to Configure Public Holidays & Mandatory Days in Odoo 18
Celine George
 
Sugar-Sensing Mechanism in plants....pptx
Sugar-Sensing Mechanism in plants....pptxSugar-Sensing Mechanism in plants....pptx
Sugar-Sensing Mechanism in plants....pptx
Dr. Renu Jangid
 
Grade 2 - Mathematics - Printable Worksheet
Grade 2 - Mathematics - Printable WorksheetGrade 2 - Mathematics - Printable Worksheet
Grade 2 - Mathematics - Printable Worksheet
Sritoma Majumder
 
Drive Supporter Growth from Awareness to Advocacy with TechSoup Marketing Ser...
Drive Supporter Growth from Awareness to Advocacy with TechSoup Marketing Ser...Drive Supporter Growth from Awareness to Advocacy with TechSoup Marketing Ser...
Drive Supporter Growth from Awareness to Advocacy with TechSoup Marketing Ser...
TechSoup
 
How to Configure Scheduled Actions in odoo 18
How to Configure Scheduled Actions in odoo 18How to Configure Scheduled Actions in odoo 18
How to Configure Scheduled Actions in odoo 18
Celine George
 
BỘ ĐỀ TUYỂN SINH VÀO LỚP 10 TIẾNG ANH - 25 ĐỀ THI BÁM SÁT CẤU TRÚC MỚI NHẤT, ...
BỘ ĐỀ TUYỂN SINH VÀO LỚP 10 TIẾNG ANH - 25 ĐỀ THI BÁM SÁT CẤU TRÚC MỚI NHẤT, ...BỘ ĐỀ TUYỂN SINH VÀO LỚP 10 TIẾNG ANH - 25 ĐỀ THI BÁM SÁT CẤU TRÚC MỚI NHẤT, ...
BỘ ĐỀ TUYỂN SINH VÀO LỚP 10 TIẾNG ANH - 25 ĐỀ THI BÁM SÁT CẤU TRÚC MỚI NHẤT, ...
Nguyen Thanh Tu Collection
 
Bridging the Transit Gap: Equity Drive Feeder Bus Design for Southeast Brooklyn
Bridging the Transit Gap: Equity Drive Feeder Bus Design for Southeast BrooklynBridging the Transit Gap: Equity Drive Feeder Bus Design for Southeast Brooklyn
Bridging the Transit Gap: Equity Drive Feeder Bus Design for Southeast Brooklyn
i4jd41bk
 
Lecture 2 CLASSIFICATION OF PHYLUM ARTHROPODA UPTO CLASSES & POSITION OF_1.pptx
Lecture 2 CLASSIFICATION OF PHYLUM ARTHROPODA UPTO CLASSES & POSITION OF_1.pptxLecture 2 CLASSIFICATION OF PHYLUM ARTHROPODA UPTO CLASSES & POSITION OF_1.pptx
Lecture 2 CLASSIFICATION OF PHYLUM ARTHROPODA UPTO CLASSES & POSITION OF_1.pptx
Arshad Shaikh
 
LDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDMMIA Reiki News Ed3 Vol1 For Team and GuestsLDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDM Mia eStudios
 
How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 
Lecture 4 INSECT CUTICLE and moulting.pptx
Lecture 4 INSECT CUTICLE and moulting.pptxLecture 4 INSECT CUTICLE and moulting.pptx
Lecture 4 INSECT CUTICLE and moulting.pptx
Arshad Shaikh
 
Ancient Stone Sculptures of India: As a Source of Indian History
Ancient Stone Sculptures of India: As a Source of Indian HistoryAncient Stone Sculptures of India: As a Source of Indian History
Ancient Stone Sculptures of India: As a Source of Indian History
Virag Sontakke
 
APGAR SCORE BY sweety Tamanna Mahapatra MSc Pediatric
APGAR SCORE  BY sweety Tamanna Mahapatra MSc PediatricAPGAR SCORE  BY sweety Tamanna Mahapatra MSc Pediatric
APGAR SCORE BY sweety Tamanna Mahapatra MSc Pediatric
SweetytamannaMohapat
 
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