SlideShare a Scribd company logo
1 of 10
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

Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascriptambuj pathak
 
4007655 introduction-to-javascript
4007655 introduction-to-javascript4007655 introduction-to-javascript
4007655 introduction-to-javascriptVikash Chandra
 
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 - Week4Devang Garach
 
Active browser web page
Active browser web pageActive browser web page
Active browser web pageZee1481
 
JavaScript with Syntax & Implementation
JavaScript with Syntax & ImplementationJavaScript with Syntax & Implementation
JavaScript with Syntax & ImplementationSoumen Santra
 
Lecture 6 Footnotes&amp; Answers
Lecture 6  Footnotes&amp; AnswersLecture 6  Footnotes&amp; Answers
Lecture 6 Footnotes&amp; Answersis4030.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
 
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.pptxrish15r890
 
8.-Javascript-report powerpoint presentation
8.-Javascript-report powerpoint presentation8.-Javascript-report powerpoint presentation
8.-Javascript-report powerpoint presentationJohnLagman3
 
Java script Basic
Java script BasicJava script Basic
Java script BasicJaya Kumari
 
Basics java scripts
Basics java scriptsBasics java scripts
Basics java scriptsch samaram
 
Client side scripting using Javascript
Client side scripting using JavascriptClient side scripting using Javascript
Client side scripting using JavascriptBansari Shah
 
1. java script language fundamentals
1. java script language fundamentals1. java script language fundamentals
1. java script language fundamentalsRajiv Gupta
 

Similar to Computer Science:JavaScript (20)

JAVA SCRIPT
JAVA SCRIPTJAVA SCRIPT
JAVA SCRIPT
 
wp-UNIT_III.pptx
wp-UNIT_III.pptxwp-UNIT_III.pptx
wp-UNIT_III.pptx
 
Reacting to a Virtual World
Reacting to a Virtual WorldReacting to a Virtual World
Reacting to a Virtual World
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascript
 
4007655 introduction-to-javascript
4007655 introduction-to-javascript4007655 introduction-to-javascript
4007655 introduction-to-javascript
 
Message Box in JS
Message Box in JSMessage Box in JS
Message Box in JS
 
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
 
Active browser web page
Active browser web pageActive browser web page
Active browser web page
 
JavaScript with Syntax & Implementation
JavaScript with Syntax & ImplementationJavaScript with Syntax & Implementation
JavaScript with Syntax & Implementation
 
Lecture 6 Footnotes&amp; Answers
Lecture 6  Footnotes&amp; AnswersLecture 6  Footnotes&amp; Answers
Lecture 6 Footnotes&amp; Answers
 
Basic Java script handouts for students
Basic Java script handouts for students Basic Java script handouts for students
Basic Java script handouts for students
 
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
 
8.-Javascript-report powerpoint presentation
8.-Javascript-report powerpoint presentation8.-Javascript-report powerpoint presentation
8.-Javascript-report powerpoint presentation
 
Java script Basic
Java script BasicJava script Basic
Java script Basic
 
Basics java scripts
Basics java scriptsBasics java scripts
Basics java scripts
 
Unit 4(it workshop)
Unit 4(it workshop)Unit 4(it workshop)
Unit 4(it workshop)
 
Java script
Java scriptJava script
Java script
 
Client side scripting using Javascript
Client side scripting using JavascriptClient side scripting using Javascript
Client side scripting using Javascript
 
1. java script language fundamentals
1. java script language fundamentals1. java script language fundamentals
1. java script language fundamentals
 
Java Script
Java ScriptJava Script
Java Script
 

More from 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 MicrobiologySt Mary's College,Thrissur,Kerala
 

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
 
Magnetic Tape
Magnetic TapeMagnetic Tape
Magnetic Tape
 
Online Data Storage
Online Data StorageOnline Data Storage
Online Data Storage
 
Mathematics:Cryptography
Mathematics:CryptographyMathematics:Cryptography
Mathematics:Cryptography
 
Mathematics:Arithmetical Functions
Mathematics:Arithmetical FunctionsMathematics:Arithmetical Functions
Mathematics:Arithmetical Functions
 
Physical education :Yoga For Stress Relief
Physical education :Yoga For Stress ReliefPhysical education :Yoga For Stress Relief
Physical education :Yoga For Stress Relief
 
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
 
Economics:Functions
Economics:FunctionsEconomics:Functions
Economics:Functions
 
Mathematics:H-Complexity
Mathematics:H-ComplexityMathematics:H-Complexity
Mathematics:H-Complexity
 
Statistics:Probability Theory
Statistics:Probability TheoryStatistics:Probability Theory
Statistics:Probability Theory
 
Statistics:Fundamentals Of Statistics
Statistics:Fundamentals Of StatisticsStatistics:Fundamentals Of Statistics
Statistics:Fundamentals Of Statistics
 
Economics:Public Revenue
Economics:Public RevenueEconomics:Public Revenue
Economics:Public Revenue
 
Economics:Public Debt
Economics:Public  DebtEconomics:Public  Debt
Economics:Public Debt
 
Economics:Poverty-perspectives And Dimensions
Economics:Poverty-perspectives And DimensionsEconomics:Poverty-perspectives And Dimensions
Economics:Poverty-perspectives And Dimensions
 
Economics:Economic Integration
Economics:Economic IntegrationEconomics:Economic Integration
Economics:Economic Integration
 
Economics:Enviornmental Pollution
Economics:Enviornmental Pollution Economics:Enviornmental Pollution
Economics:Enviornmental Pollution
 
Computer Science:Sql Set Operation
Computer Science:Sql Set OperationComputer Science:Sql Set Operation
Computer Science:Sql Set Operation
 
Computer Science:Java jdbc
Computer Science:Java jdbcComputer Science:Java jdbc
Computer Science:Java jdbc
 
Microbiology:General Principles of Food Preservation
Microbiology:General Principles of Food PreservationMicrobiology:General Principles of Food Preservation
Microbiology:General Principles of Food Preservation
 
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
 

Recently uploaded

How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 

Recently uploaded (20)

How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 

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