SlideShare a Scribd company logo
JavaScript
M.Rishi Vinthiya
M.Sc(info.tech)
Nadar Saraswathi College Of Arts & Science,Theni
Introduction to JavaScript
 What is JavaScript?
◦ It is designed to add interactivity to HTML
pages.
◦ It is a scripting language (a lightweight
programming language).
◦ It is an interpreted language (it executes
without preliminary compilation).
◦ Usually embedded directly into HTML pages.
◦ And, Java and JavaScript are different.
What can a JavaScript Do?
 JavaScript gives HTML designers a programming
tool:
◦ simple syntax
 JavaScript can put dynamic text into an HTML
page.
 JavaScript can react to events.
 JavaScript can read and write HTML elements.
 JavaScript can be used to validate data.
 JavaScript can be used to detect the visitor’s
browser.
 JavaScript can be used to create cookies
◦ Store and retrieve information on the visitor’s computer
JavaScript How To
 The HTML <script> tag is used to insert a JavaScript into an
HTML page
<script type=“text/javascript”>
document.write(“Hello World!”)
</script>
 Ending statements with a semicolon?
◦ Optional; required when you want to put multiple statements on a
single line
 JavaScript can be inserted within the head, the body, or use
external JavaScript file
 How to handle older browsers?
<script type=“text/javascript”>
<!—
document. write(“Hello World!”)
// -->
</script>
JavaScript Where To
 You can include Java Scripts in head,
body, or simply use external JavaScript
file (.js).
 Java Scripts in the body section will be
executed while the page loads.
 Java Scripts in the head section will be
executed when called.
JavaScript Basics
 Variables
 If … Else
 Switch
 Operators
 Popup Boxes
 Functions
 Loops (for, while)
 Events
 Try … Catch
 Throw
 onerror
 Special Text
 Guidelines
Java Objects
 String
 Date
 Array
 Boolean
 Math
 RegExp
 HTML DOM
Regular Expression
 Two ways to define regular expression:
◦ new RegExp(“[xyz]”)
◦ or, /[xyz]/
 String object methods that supports regular
expressions:
◦ search: search a string for a specified value.
Returns the position of the value
◦ match: search a string for a specified value.
Returns an array of the found value(s)
◦ replace: replace characters with other characters
◦ split: split a string into an array of strings
Using JavaScript Objects
 When you load a document in your web
browser, it creates a number of JavaScript
objects.
 These objects exist in a hierarchy that
reflects the structure of the HTML page.
Java Advanced
 Browser
 Cookies
 Validation
 Animation
 Timing
 Create your own object

More Related Content

PPTX
Javascript
PPTX
Java script
PPTX
Efficient use of jQuery selector
PPTX
Introduction to java_script
PDF
Ng init | EPI Sousse
PPTX
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
PPT
Tech Gupshup Meetup On MongoDB - 24/06/2016
PDF
JAVA SCRIPT
Javascript
Java script
Efficient use of jQuery selector
Introduction to java_script
Ng init | EPI Sousse
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
Tech Gupshup Meetup On MongoDB - 24/06/2016
JAVA SCRIPT

What's hot (20)

PPTX
Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology
PPTX
Java script
PPT
JavaScript: Ajax & DOM Manipulation
PPTX
Tips for writing Javascript for Drupal
PPTX
Javascipt
PPTX
Internet and Web Technology (CLASS-9) [React.js] | NIC/NIELIT Web Technology
PDF
Unit 4(it workshop)
PPT
KMUTNB - Internet Programming 4/7
PDF
Drupal.Behaviors
PDF
JavaScript - Chapter 8 - Objects
ODP
Consume Spring Data Rest with Angularjs
PPTX
Java script objects
PDF
Javascript jQuery jQuery Ui
PPTX
Introduction to Programming (well, kind of.)
PPTX
JS basics
KEY
Introduction to the wonderful world of JavaScript
PPTX
Css Selectors
PPT
jQuery Beginner
PDF
jQuery Introduction
PPT
JS Libraries and jQuery Overview
Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology
Java script
JavaScript: Ajax & DOM Manipulation
Tips for writing Javascript for Drupal
Javascipt
Internet and Web Technology (CLASS-9) [React.js] | NIC/NIELIT Web Technology
Unit 4(it workshop)
KMUTNB - Internet Programming 4/7
Drupal.Behaviors
JavaScript - Chapter 8 - Objects
Consume Spring Data Rest with Angularjs
Java script objects
Javascript jQuery jQuery Ui
Introduction to Programming (well, kind of.)
JS basics
Introduction to the wonderful world of JavaScript
Css Selectors
jQuery Beginner
jQuery Introduction
JS Libraries and jQuery Overview
Ad

Similar to Java script (20)

PDF
CS8651- Unit 2 - JS.internet programming paper anna university -2017 regulation
PPTX
JavaScript_III.pptx
PPTX
Lecture 5 javascript
PDF
8.-Javascript-report powerpoint presentation
PDF
javascriptPresentation.pdf
PPT
JAVA SCRIPT
PPTX
Javascript 01 (js)
PPTX
WT Module-3.pptx
PPTX
JavaScript: Implementations And Applications
PPTX
JavaScript New Tutorial Class XI and XII.pptx
PPT
Java script
PPT
Java script
DOC
Basics java scripts
PPTX
JavaScript lesson 1.pptx
PPT
Html JavaScript and CSS
PPTX
Client side scripting using Javascript
PDF
Basic JavaScript Tutorial
PDF
JS BASICS JAVA SCRIPT SCRIPTING
PDF
java-scriptcdvcx vnbm,azsdfghjkml;sxdfcgmndxfcgvhb nmfctgvbhjnm ,cfgvb nm,xc ...
PPTX
Java script
CS8651- Unit 2 - JS.internet programming paper anna university -2017 regulation
JavaScript_III.pptx
Lecture 5 javascript
8.-Javascript-report powerpoint presentation
javascriptPresentation.pdf
JAVA SCRIPT
Javascript 01 (js)
WT Module-3.pptx
JavaScript: Implementations And Applications
JavaScript New Tutorial Class XI and XII.pptx
Java script
Java script
Basics java scripts
JavaScript lesson 1.pptx
Html JavaScript and CSS
Client side scripting using Javascript
Basic JavaScript Tutorial
JS BASICS JAVA SCRIPT SCRIPTING
java-scriptcdvcx vnbm,azsdfghjkml;sxdfcgmndxfcgvhb nmfctgvbhjnm ,cfgvb nm,xc ...
Java script
Ad

More from rajshreemuthiah (20)

PPTX
PPTX
PPTX
PPTX
polymorphism
PPTX
solutions and understanding text analytics
PPTX
interface
PPTX
Testing &ampdebugging
PPTX
concurrency control
PPTX
Education
PPTX
Formal verification
PPTX
Transaction management
PPTX
Multi thread
PPTX
System testing
PPTX
software maintenance
PPTX
exception handling
PPTX
e governance
PPTX
recovery management
PPTX
Implementing polymorphism
PPSX
Buffer managements
PPTX
os linux
polymorphism
solutions and understanding text analytics
interface
Testing &ampdebugging
concurrency control
Education
Formal verification
Transaction management
Multi thread
System testing
software maintenance
exception handling
e governance
recovery management
Implementing polymorphism
Buffer managements
os linux

Recently uploaded (20)

PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PPTX
Machine Learning_overview_presentation.pptx
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Programs and apps: productivity, graphics, security and other tools
PPT
Teaching material agriculture food technology
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
A Presentation on Artificial Intelligence
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Approach and Philosophy of On baking technology
PDF
Machine learning based COVID-19 study performance prediction
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Machine Learning_overview_presentation.pptx
NewMind AI Weekly Chronicles - August'25-Week II
Unlocking AI with Model Context Protocol (MCP)
Network Security Unit 5.pdf for BCA BBA.
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Programs and apps: productivity, graphics, security and other tools
Teaching material agriculture food technology
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
A Presentation on Artificial Intelligence
Building Integrated photovoltaic BIPV_UPV.pdf
Empathic Computing: Creating Shared Understanding
MIND Revenue Release Quarter 2 2025 Press Release
Diabetes mellitus diagnosis method based random forest with bat algorithm
Approach and Philosophy of On baking technology
Machine learning based COVID-19 study performance prediction
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Digital-Transformation-Roadmap-for-Companies.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Mobile App Security Testing_ A Comprehensive Guide.pdf

Java script

  • 2. Introduction to JavaScript  What is JavaScript? ◦ It is designed to add interactivity to HTML pages. ◦ It is a scripting language (a lightweight programming language). ◦ It is an interpreted language (it executes without preliminary compilation). ◦ Usually embedded directly into HTML pages. ◦ And, Java and JavaScript are different.
  • 3. What can a JavaScript Do?  JavaScript gives HTML designers a programming tool: ◦ simple syntax  JavaScript can put dynamic text into an HTML page.  JavaScript can react to events.  JavaScript can read and write HTML elements.  JavaScript can be used to validate data.  JavaScript can be used to detect the visitor’s browser.  JavaScript can be used to create cookies ◦ Store and retrieve information on the visitor’s computer
  • 4. JavaScript How To  The HTML <script> tag is used to insert a JavaScript into an HTML page <script type=“text/javascript”> document.write(“Hello World!”) </script>  Ending statements with a semicolon? ◦ Optional; required when you want to put multiple statements on a single line  JavaScript can be inserted within the head, the body, or use external JavaScript file  How to handle older browsers? <script type=“text/javascript”> <!— document. write(“Hello World!”) // --> </script>
  • 5. JavaScript Where To  You can include Java Scripts in head, body, or simply use external JavaScript file (.js).  Java Scripts in the body section will be executed while the page loads.  Java Scripts in the head section will be executed when called.
  • 6. JavaScript Basics  Variables  If … Else  Switch  Operators  Popup Boxes  Functions  Loops (for, while)  Events  Try … Catch  Throw  onerror  Special Text  Guidelines
  • 7. Java Objects  String  Date  Array  Boolean  Math  RegExp  HTML DOM
  • 8. Regular Expression  Two ways to define regular expression: ◦ new RegExp(“[xyz]”) ◦ or, /[xyz]/  String object methods that supports regular expressions: ◦ search: search a string for a specified value. Returns the position of the value ◦ match: search a string for a specified value. Returns an array of the found value(s) ◦ replace: replace characters with other characters ◦ split: split a string into an array of strings
  • 9. Using JavaScript Objects  When you load a document in your web browser, it creates a number of JavaScript objects.  These objects exist in a hierarchy that reflects the structure of the HTML page.
  • 10. Java Advanced  Browser  Cookies  Validation  Animation  Timing  Create your own object