SlideShare a Scribd company logo
Understanding JavaScript and
Coding Essentials
Lesson 8
Exam Objective Matrix
Skills/Concepts

MTA Exam Objectives

Managing and Maintaining
JavaScript
Updating the UI by Using
JavaScript

Manage and maintain JavaScript. (4.1)
Update the UI by using JavaScript. (4.2)
Introduction to JavaScript
• JavaScript is a programming language
that provides action in applications.
• Interactivity enables an end user to take
an action in an application, usually by
clicking a button or pressing a key.
• A dynamic application adjusts and
responds to such actions by end users.
• JavaScript also expands the opportunities
to animate content.
Alert Boxes
• Alert boxes are commonly used to test the
operation of JavaScript programs.
• Generally not used in production code.
• An alert box can help you ensure
information is displayed to the user.
• A user has to click OK to close an alert
box.
JavaScript Statements
• An ordinary JavaScript program is a
sequence of statements.
• Statements are separated by semi-colons.
alert('This is the first alert');
alert('This is the second alert');
Create a Simple JavaScript Application
Create a Simple JavaScript Application
Enabling JavaScript in a Web Browser
• Enabling JavaScript
in Internet
Explorer
Functions
• A function is a segment of a program
defined and performed in isolation from
other parts.
• JavaScript programmers sometimes
identify functions that return no value as
subroutines.
Functions (Continued)
• The expression of a function—the
―function example1() {. . .}‖ part—doesn’t
perform any of the code within the
function.
• What you see in the source code is only
the definition of a function.
• When the function is invoked, executed, or
launched, something useful happen.
Function Example
Function Example
Links between HTML and JavaScript
• Can include JavaScript code in <script>
tags in <head> section of HTML file for
small to medium-sized projects
• For large amounts of code, reference a
separate JavaScript file within the
<script> tag:
<script type = "text/javascript" src =
path/filename.js"></script>
Variables
• A JavaScript variable stands for a piece of
data.
• You use the var syntax to define a new
variable in JavaScript:
var firstname;
Identifiers
• JavaScript identifiers are the names of
variables and functions.
• Identifiers cannot be the same as
keywords already used in JavaScript.
• For example, ―if ‖ has a special meaning in
JavaScript statements and is not available
as a variable name.
JavaScript Libraries
• A library is collection of resources, like
pre-written function code and subroutines,
that developers use to create programs.
• A JavaScript library is pre-written
JavaScript code.
• jQuery is the leading JavaScript library.
• Other popular libraries include Dojo,
MooTools, and YUI.
JavaScript Libraries (Continued)
• When using a third-party library, include
an element such as the following to
reference the library:
<script type = "text/javascript" src =
"web or local address of the JavaScript
library source"></script>
getElementById() Method
• One important way to access display
elements is with the getElementById()
method.
• This method returns a reference to the first
object with the specified id or NAME
attribute.
getElementById() Example
Methods
• Methods are JavaScript functions that belong to
objects.
• Methods differ from functions in that methods are
always associated and used with a particular object.
• isNaN() is an example of a JavaScript function.

– Tests for ―not a number‖; if value = 0 (false),
value is a number
• document.getElementById() is an example of
a JavaScript method; you can effectively only use
getElementById with the special document
object.
Events
• Events are actions that trigger other
actions to occur.
• An event handler is an optional script or
executable that handles input received in a
program. Handlers are JavaScript code
inside the <html> tags (rather than the
<script> tags) that execute other
JavaScript code in response to an event.
Events (Continued)
• A callback is a response to an event,
such as a script execution in response to a
mouse click.
onLoad Event Handler
• The onLoad event handler ―belongs‖ to
HTML items; it triggers when its owner is
complete.
• The onLoad for an <img> image occurs
when the image is fully rendered and
visible.
• The onLoad for a <table> fires once all the
cells in that table have been drawn.
onLoad Example
onLoad Example (Continued)
Flawed JavaScript Programs Are Erratic
• Flawed JavaScript programs are erratic—
they give different results at different times.
• Reasons:
– If the program depends on the existence of a
particular screen element but doesn’t assure
that the element exists
– Launching the program at different times,
resulting in slightly different loading order

• Fix: Begin calculations only after onLoad has
fired.
Showing and Hiding Elements
• The HTML display attribute shows the
user pertinent information and hides the
information when no longer needed.
HTML display Attribute Example
HTML display Attribute Example (Cont.)
Updating the Content of Elements
• JavaScript uses the innerHTML property to
change the current content of HTML
elements (referred to as ―inner content‖) or
insert new content.
innerHTML Example
innerHTML Example (Continued)
Recap
• Introduction to JavaScript
– Alert boxes
– JavaScript statements

•
•
•
•
•
•
•
•
•
•

Creating a simple JavaScript application
Functions
Links between HTML and JavaScript
Variables
Identifiers
JavaScript libraries
Methods
Events
Showing and hiding elements
Updating the content of elements

More Related Content

What's hot (20)

Java script final presentation
Java script final presentationJava script final presentation
Java script final presentation
Adhoura Academy
 
EasyTest Test Automation Tool Introduction
EasyTest Test Automation Tool IntroductionEasyTest Test Automation Tool Introduction
EasyTest Test Automation Tool Introduction
Zhu Zhong
 
Introduction to TypeScript by Winston Levi
Introduction to TypeScript by Winston LeviIntroduction to TypeScript by Winston Levi
Introduction to TypeScript by Winston Levi
Winston Levi
 
Using Specflow for BDD
Using Specflow for BDDUsing Specflow for BDD
Using Specflow for BDD
Abhimanyu Singhal
 
Selenium Design Patterns
Selenium Design PatternsSelenium Design Patterns
Selenium Design Patterns
Liraz Shay
 
Oracle 10g Forms Lesson 13
Oracle 10g Forms Lesson 13Oracle 10g Forms Lesson 13
Oracle 10g Forms Lesson 13
KAMA3
 
Extjs
ExtjsExtjs
Extjs
Girish Srivastava
 
Java Script
Java ScriptJava Script
Java Script
husbancom
 
Crafting high quality code
Crafting high quality code Crafting high quality code
Crafting high quality code
Allan Mangune
 
QTP Automation Testing Tutorial 6
QTP Automation Testing Tutorial 6QTP Automation Testing Tutorial 6
QTP Automation Testing Tutorial 6
Akash Tyagi
 
Devday2016 real unittestingwithmockframework-phatvu
Devday2016 real unittestingwithmockframework-phatvuDevday2016 real unittestingwithmockframework-phatvu
Devday2016 real unittestingwithmockframework-phatvu
Phat VU
 
QTP Power Point Presentation
QTP Power Point PresentationQTP Power Point Presentation
QTP Power Point Presentation
SVRTechnologies
 
Architectural Patterns - Interactive and Event Handling Patterns
Architectural Patterns  - Interactive and Event Handling PatternsArchitectural Patterns  - Interactive and Event Handling Patterns
Architectural Patterns - Interactive and Event Handling Patterns
assinha
 
JavaScript Core fundamentals - Learn JavaScript Here
JavaScript Core fundamentals - Learn JavaScript HereJavaScript Core fundamentals - Learn JavaScript Here
JavaScript Core fundamentals - Learn JavaScript Here
Laurence Svekis ✔
 
Getting started with typescript
Getting started with typescriptGetting started with typescript
Getting started with typescript
C...L, NESPRESSO, WAFAASSURANCE, SOFRECOM ORANGE
 
Modern Java Development
Modern Java DevelopmentModern Java Development
Modern Java Development
Peerapat Asoktummarungsri
 
Introduction to java script
Introduction to java scriptIntroduction to java script
Introduction to java script
DivyaKS12
 
Java 101 intro to programming with java
Java 101  intro to programming with javaJava 101  intro to programming with java
Java 101 intro to programming with java
Hawkman Academy
 
Built to last javascript for enterprise
Built to last   javascript for enterpriseBuilt to last   javascript for enterprise
Built to last javascript for enterprise
Marjan Nikolovski
 
L06 Using Design Patterns
L06 Using Design PatternsL06 Using Design Patterns
L06 Using Design Patterns
Ólafur Andri Ragnarsson
 
Java script final presentation
Java script final presentationJava script final presentation
Java script final presentation
Adhoura Academy
 
EasyTest Test Automation Tool Introduction
EasyTest Test Automation Tool IntroductionEasyTest Test Automation Tool Introduction
EasyTest Test Automation Tool Introduction
Zhu Zhong
 
Introduction to TypeScript by Winston Levi
Introduction to TypeScript by Winston LeviIntroduction to TypeScript by Winston Levi
Introduction to TypeScript by Winston Levi
Winston Levi
 
Selenium Design Patterns
Selenium Design PatternsSelenium Design Patterns
Selenium Design Patterns
Liraz Shay
 
Oracle 10g Forms Lesson 13
Oracle 10g Forms Lesson 13Oracle 10g Forms Lesson 13
Oracle 10g Forms Lesson 13
KAMA3
 
Crafting high quality code
Crafting high quality code Crafting high quality code
Crafting high quality code
Allan Mangune
 
QTP Automation Testing Tutorial 6
QTP Automation Testing Tutorial 6QTP Automation Testing Tutorial 6
QTP Automation Testing Tutorial 6
Akash Tyagi
 
Devday2016 real unittestingwithmockframework-phatvu
Devday2016 real unittestingwithmockframework-phatvuDevday2016 real unittestingwithmockframework-phatvu
Devday2016 real unittestingwithmockframework-phatvu
Phat VU
 
QTP Power Point Presentation
QTP Power Point PresentationQTP Power Point Presentation
QTP Power Point Presentation
SVRTechnologies
 
Architectural Patterns - Interactive and Event Handling Patterns
Architectural Patterns  - Interactive and Event Handling PatternsArchitectural Patterns  - Interactive and Event Handling Patterns
Architectural Patterns - Interactive and Event Handling Patterns
assinha
 
JavaScript Core fundamentals - Learn JavaScript Here
JavaScript Core fundamentals - Learn JavaScript HereJavaScript Core fundamentals - Learn JavaScript Here
JavaScript Core fundamentals - Learn JavaScript Here
Laurence Svekis ✔
 
Introduction to java script
Introduction to java scriptIntroduction to java script
Introduction to java script
DivyaKS12
 
Java 101 intro to programming with java
Java 101  intro to programming with javaJava 101  intro to programming with java
Java 101 intro to programming with java
Hawkman Academy
 
Built to last javascript for enterprise
Built to last   javascript for enterpriseBuilt to last   javascript for enterprise
Built to last javascript for enterprise
Marjan Nikolovski
 

Viewers also liked (7)

Baikpulih dan penyenggaraan t6
Baikpulih dan penyenggaraan t6Baikpulih dan penyenggaraan t6
Baikpulih dan penyenggaraan t6
Dinamani Yeoges
 
HidashHi Brochure
HidashHi BrochureHidashHi Brochure
HidashHi Brochure
HidashHi
 
Biodiversidade
Biodiversidade Biodiversidade
Biodiversidade
Rita Pereira
 
Distribuição de materia nas plantas
Distribuição de materia nas plantasDistribuição de materia nas plantas
Distribuição de materia nas plantas
Rita Pereira
 
Presentación final la fotografía en la escuela
Presentación final   la fotografía en la escuelaPresentación final   la fotografía en la escuela
Presentación final la fotografía en la escuela
elenasangar
 
Resume
ResumeResume
Resume
Sandeep Rout
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsStudy: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving Cars
LinkedIn
 
Baikpulih dan penyenggaraan t6
Baikpulih dan penyenggaraan t6Baikpulih dan penyenggaraan t6
Baikpulih dan penyenggaraan t6
Dinamani Yeoges
 
HidashHi Brochure
HidashHi BrochureHidashHi Brochure
HidashHi Brochure
HidashHi
 
Distribuição de materia nas plantas
Distribuição de materia nas plantasDistribuição de materia nas plantas
Distribuição de materia nas plantas
Rita Pereira
 
Presentación final la fotografía en la escuela
Presentación final   la fotografía en la escuelaPresentación final   la fotografía en la escuela
Presentación final la fotografía en la escuela
elenasangar
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsStudy: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving Cars
LinkedIn
 
Ad

Similar to MTA understanding java script and coding essentials (20)

Javascript
JavascriptJavascript
Javascript
Nagarajan
 
UNIT 3.ppt
UNIT 3.pptUNIT 3.ppt
UNIT 3.ppt
MadhurRajVerma1
 
Unit 2.4
Unit 2.4Unit 2.4
Unit 2.4
Abhishek Kesharwani
 
Basics of Java Script (JS)
Basics of Java Script (JS)Basics of Java Script (JS)
Basics of Java Script (JS)
Ajay Khatri
 
Iwt note(module 2)
Iwt note(module 2)Iwt note(module 2)
Iwt note(module 2)
SANTOSH RATH
 
[2015/2016] JavaScript
[2015/2016] JavaScript[2015/2016] JavaScript
[2015/2016] JavaScript
Ivano Malavolta
 
Welcome to React.pptx
Welcome to React.pptxWelcome to React.pptx
Welcome to React.pptx
PraveenKumar680401
 
Introduction to JAVA SCRIPT USING HTML and CSS
Introduction to JAVA SCRIPT USING HTML and CSSIntroduction to JAVA SCRIPT USING HTML and CSS
Introduction to JAVA SCRIPT USING HTML and CSS
ManasaMR2
 
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
 
Lab #2: Introduction to Javascript
Lab #2: Introduction to JavascriptLab #2: Introduction to Javascript
Lab #2: Introduction to Javascript
Walid Ashraf
 
8.-Javascript-report powerpoint presentation
8.-Javascript-report powerpoint presentation8.-Javascript-report powerpoint presentation
8.-Javascript-report powerpoint presentation
JohnLagman3
 
Lecture 10.pdf
Lecture 10.pdfLecture 10.pdf
Lecture 10.pdf
ssuser0890d1
 
Java Script notes
Java Script notesJava Script notes
Java Script notes
ANNIEJAN
 
javascriptPresentation.pdf
javascriptPresentation.pdfjavascriptPresentation.pdf
javascriptPresentation.pdf
wildcat9335
 
javaScript and jQuery
javaScript and jQueryjavaScript and jQuery
javaScript and jQuery
Mehrab Hossain
 
WT Module-3.pptx
WT Module-3.pptxWT Module-3.pptx
WT Module-3.pptx
RamyaH11
 
Lecture 5 javascript
Lecture 5 javascriptLecture 5 javascript
Lecture 5 javascript
Mujtaba Haider
 
Unit 2.4
Unit 2.4Unit 2.4
Unit 2.4
Abhishek Kesharwani
 
FFW Gabrovo PMG - JavaScript 1
FFW Gabrovo PMG - JavaScript 1FFW Gabrovo PMG - JavaScript 1
FFW Gabrovo PMG - JavaScript 1
Toni Kolev
 
JavaScript for real men
JavaScript for real menJavaScript for real men
JavaScript for real men
Ivano Malavolta
 
Basics of Java Script (JS)
Basics of Java Script (JS)Basics of Java Script (JS)
Basics of Java Script (JS)
Ajay Khatri
 
Iwt note(module 2)
Iwt note(module 2)Iwt note(module 2)
Iwt note(module 2)
SANTOSH RATH
 
Introduction to JAVA SCRIPT USING HTML and CSS
Introduction to JAVA SCRIPT USING HTML and CSSIntroduction to JAVA SCRIPT USING HTML and CSS
Introduction to JAVA SCRIPT USING HTML and CSS
ManasaMR2
 
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
 
Lab #2: Introduction to Javascript
Lab #2: Introduction to JavascriptLab #2: Introduction to Javascript
Lab #2: Introduction to Javascript
Walid Ashraf
 
8.-Javascript-report powerpoint presentation
8.-Javascript-report powerpoint presentation8.-Javascript-report powerpoint presentation
8.-Javascript-report powerpoint presentation
JohnLagman3
 
Java Script notes
Java Script notesJava Script notes
Java Script notes
ANNIEJAN
 
javascriptPresentation.pdf
javascriptPresentation.pdfjavascriptPresentation.pdf
javascriptPresentation.pdf
wildcat9335
 
WT Module-3.pptx
WT Module-3.pptxWT Module-3.pptx
WT Module-3.pptx
RamyaH11
 
FFW Gabrovo PMG - JavaScript 1
FFW Gabrovo PMG - JavaScript 1FFW Gabrovo PMG - JavaScript 1
FFW Gabrovo PMG - JavaScript 1
Toni Kolev
 
Ad

Recently uploaded (20)

Optimization technique in pharmaceutical product development.pptx
Optimization technique in pharmaceutical product development.pptxOptimization technique in pharmaceutical product development.pptx
Optimization technique in pharmaceutical product development.pptx
UrmiPrajapati3
 
How to Create a Stage or a Pipeline in Odoo 18 CRM
How to Create a Stage or a Pipeline in Odoo 18 CRMHow to Create a Stage or a Pipeline in Odoo 18 CRM
How to Create a Stage or a Pipeline in Odoo 18 CRM
Celine George
 
LDMMIA Reiki Yoga Next Week Grad Updates
LDMMIA Reiki Yoga Next Week Grad UpdatesLDMMIA Reiki Yoga Next Week Grad Updates
LDMMIA Reiki Yoga Next Week Grad Updates
LDM & Mia eStudios
 
TV Shows and web-series quiz | QUIZ CLUB OF PSGCAS | 13TH MARCH 2025
TV Shows and web-series quiz | QUIZ CLUB OF PSGCAS | 13TH MARCH 2025TV Shows and web-series quiz | QUIZ CLUB OF PSGCAS | 13TH MARCH 2025
TV Shows and web-series quiz | QUIZ CLUB OF PSGCAS | 13TH MARCH 2025
Quiz Club of PSG College of Arts & Science
 
Adam Grant: Transforming Work Culture Through Organizational Psychology
Adam Grant: Transforming Work Culture Through Organizational PsychologyAdam Grant: Transforming Work Culture Through Organizational Psychology
Adam Grant: Transforming Work Culture Through Organizational Psychology
Prachi Shah
 
june 10 2025 ppt for madden on art science is over.pptx
june 10 2025 ppt for madden on art science is over.pptxjune 10 2025 ppt for madden on art science is over.pptx
june 10 2025 ppt for madden on art science is over.pptx
roger malina
 
Rose Cultivation Practices by Kushal Lamichhane.pdf
Rose Cultivation Practices by Kushal Lamichhane.pdfRose Cultivation Practices by Kushal Lamichhane.pdf
Rose Cultivation Practices by Kushal Lamichhane.pdf
kushallamichhame
 
Different pricelists for different shops in odoo Point of Sale in Odoo 17
Different pricelists for different shops in odoo Point of Sale in Odoo 17Different pricelists for different shops in odoo Point of Sale in Odoo 17
Different pricelists for different shops in odoo Point of Sale in Odoo 17
Celine George
 
Strengthened Senior High School - Landas Tool Kit.pptx
Strengthened Senior High School - Landas Tool Kit.pptxStrengthened Senior High School - Landas Tool Kit.pptx
Strengthened Senior High School - Landas Tool Kit.pptx
SteffMusniQuiballo
 
Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...
Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...
Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...
GeorgeDiamandis11
 
"Hymenoptera: A Diverse and Fascinating Order".pptx
"Hymenoptera: A Diverse and Fascinating Order".pptx"Hymenoptera: A Diverse and Fascinating Order".pptx
"Hymenoptera: A Diverse and Fascinating Order".pptx
Arshad Shaikh
 
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
SweetytamannaMohapat
 
Cloud Computing ..PPT ( Faizan ALTAF )..
Cloud Computing ..PPT ( Faizan ALTAF )..Cloud Computing ..PPT ( Faizan ALTAF )..
Cloud Computing ..PPT ( Faizan ALTAF )..
faizanaltaf231
 
What are the benefits that dance brings?
What are the benefits that dance brings?What are the benefits that dance brings?
What are the benefits that dance brings?
memi27
 
How to Create a Rainbow Man Effect in Odoo 18
How to Create a Rainbow Man Effect in Odoo 18How to Create a Rainbow Man Effect in Odoo 18
How to Create a Rainbow Man Effect in Odoo 18
Celine George
 
Stewart Butler - OECD - How to design and deliver higher technical education ...
Stewart Butler - OECD - How to design and deliver higher technical education ...Stewart Butler - OECD - How to design and deliver higher technical education ...
Stewart Butler - OECD - How to design and deliver higher technical education ...
EduSkills OECD
 
la storia dell'Inghilterra, letteratura inglese
la storia dell'Inghilterra, letteratura inglesela storia dell'Inghilterra, letteratura inglese
la storia dell'Inghilterra, letteratura inglese
LetiziaLucente
 
Pfeiffer "Secrets to Changing Behavior in Scholarly Communication: A 2025 NIS...
Pfeiffer "Secrets to Changing Behavior in Scholarly Communication: A 2025 NIS...Pfeiffer "Secrets to Changing Behavior in Scholarly Communication: A 2025 NIS...
Pfeiffer "Secrets to Changing Behavior in Scholarly Communication: A 2025 NIS...
National Information Standards Organization (NISO)
 
Fatman Book HD Pdf by aayush songare.pdf
Fatman Book  HD Pdf by aayush songare.pdfFatman Book  HD Pdf by aayush songare.pdf
Fatman Book HD Pdf by aayush songare.pdf
Aayush Songare
 
Parenting Teens: Supporting Trust, resilience and independence
Parenting Teens: Supporting Trust, resilience and independenceParenting Teens: Supporting Trust, resilience and independence
Parenting Teens: Supporting Trust, resilience and independence
Pooky Knightsmith
 
Optimization technique in pharmaceutical product development.pptx
Optimization technique in pharmaceutical product development.pptxOptimization technique in pharmaceutical product development.pptx
Optimization technique in pharmaceutical product development.pptx
UrmiPrajapati3
 
How to Create a Stage or a Pipeline in Odoo 18 CRM
How to Create a Stage or a Pipeline in Odoo 18 CRMHow to Create a Stage or a Pipeline in Odoo 18 CRM
How to Create a Stage or a Pipeline in Odoo 18 CRM
Celine George
 
LDMMIA Reiki Yoga Next Week Grad Updates
LDMMIA Reiki Yoga Next Week Grad UpdatesLDMMIA Reiki Yoga Next Week Grad Updates
LDMMIA Reiki Yoga Next Week Grad Updates
LDM & Mia eStudios
 
Adam Grant: Transforming Work Culture Through Organizational Psychology
Adam Grant: Transforming Work Culture Through Organizational PsychologyAdam Grant: Transforming Work Culture Through Organizational Psychology
Adam Grant: Transforming Work Culture Through Organizational Psychology
Prachi Shah
 
june 10 2025 ppt for madden on art science is over.pptx
june 10 2025 ppt for madden on art science is over.pptxjune 10 2025 ppt for madden on art science is over.pptx
june 10 2025 ppt for madden on art science is over.pptx
roger malina
 
Rose Cultivation Practices by Kushal Lamichhane.pdf
Rose Cultivation Practices by Kushal Lamichhane.pdfRose Cultivation Practices by Kushal Lamichhane.pdf
Rose Cultivation Practices by Kushal Lamichhane.pdf
kushallamichhame
 
Different pricelists for different shops in odoo Point of Sale in Odoo 17
Different pricelists for different shops in odoo Point of Sale in Odoo 17Different pricelists for different shops in odoo Point of Sale in Odoo 17
Different pricelists for different shops in odoo Point of Sale in Odoo 17
Celine George
 
Strengthened Senior High School - Landas Tool Kit.pptx
Strengthened Senior High School - Landas Tool Kit.pptxStrengthened Senior High School - Landas Tool Kit.pptx
Strengthened Senior High School - Landas Tool Kit.pptx
SteffMusniQuiballo
 
Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...
Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...
Module 4 Presentation - Enhancing Competencies and Engagement Strategies in Y...
GeorgeDiamandis11
 
"Hymenoptera: A Diverse and Fascinating Order".pptx
"Hymenoptera: A Diverse and Fascinating Order".pptx"Hymenoptera: A Diverse and Fascinating Order".pptx
"Hymenoptera: A Diverse and Fascinating Order".pptx
Arshad Shaikh
 
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
SweetytamannaMohapat
 
Cloud Computing ..PPT ( Faizan ALTAF )..
Cloud Computing ..PPT ( Faizan ALTAF )..Cloud Computing ..PPT ( Faizan ALTAF )..
Cloud Computing ..PPT ( Faizan ALTAF )..
faizanaltaf231
 
What are the benefits that dance brings?
What are the benefits that dance brings?What are the benefits that dance brings?
What are the benefits that dance brings?
memi27
 
How to Create a Rainbow Man Effect in Odoo 18
How to Create a Rainbow Man Effect in Odoo 18How to Create a Rainbow Man Effect in Odoo 18
How to Create a Rainbow Man Effect in Odoo 18
Celine George
 
Stewart Butler - OECD - How to design and deliver higher technical education ...
Stewart Butler - OECD - How to design and deliver higher technical education ...Stewart Butler - OECD - How to design and deliver higher technical education ...
Stewart Butler - OECD - How to design and deliver higher technical education ...
EduSkills OECD
 
la storia dell'Inghilterra, letteratura inglese
la storia dell'Inghilterra, letteratura inglesela storia dell'Inghilterra, letteratura inglese
la storia dell'Inghilterra, letteratura inglese
LetiziaLucente
 
Fatman Book HD Pdf by aayush songare.pdf
Fatman Book  HD Pdf by aayush songare.pdfFatman Book  HD Pdf by aayush songare.pdf
Fatman Book HD Pdf by aayush songare.pdf
Aayush Songare
 
Parenting Teens: Supporting Trust, resilience and independence
Parenting Teens: Supporting Trust, resilience and independenceParenting Teens: Supporting Trust, resilience and independence
Parenting Teens: Supporting Trust, resilience and independence
Pooky Knightsmith
 

MTA understanding java script and coding essentials

  • 2. Exam Objective Matrix Skills/Concepts MTA Exam Objectives Managing and Maintaining JavaScript Updating the UI by Using JavaScript Manage and maintain JavaScript. (4.1) Update the UI by using JavaScript. (4.2)
  • 3. Introduction to JavaScript • JavaScript is a programming language that provides action in applications. • Interactivity enables an end user to take an action in an application, usually by clicking a button or pressing a key. • A dynamic application adjusts and responds to such actions by end users. • JavaScript also expands the opportunities to animate content.
  • 4. Alert Boxes • Alert boxes are commonly used to test the operation of JavaScript programs. • Generally not used in production code. • An alert box can help you ensure information is displayed to the user. • A user has to click OK to close an alert box.
  • 5. JavaScript Statements • An ordinary JavaScript program is a sequence of statements. • Statements are separated by semi-colons. alert('This is the first alert'); alert('This is the second alert');
  • 6. Create a Simple JavaScript Application
  • 7. Create a Simple JavaScript Application
  • 8. Enabling JavaScript in a Web Browser • Enabling JavaScript in Internet Explorer
  • 9. Functions • A function is a segment of a program defined and performed in isolation from other parts. • JavaScript programmers sometimes identify functions that return no value as subroutines.
  • 10. Functions (Continued) • The expression of a function—the ―function example1() {. . .}‖ part—doesn’t perform any of the code within the function. • What you see in the source code is only the definition of a function. • When the function is invoked, executed, or launched, something useful happen.
  • 13. Links between HTML and JavaScript • Can include JavaScript code in <script> tags in <head> section of HTML file for small to medium-sized projects • For large amounts of code, reference a separate JavaScript file within the <script> tag: <script type = "text/javascript" src = path/filename.js"></script>
  • 14. Variables • A JavaScript variable stands for a piece of data. • You use the var syntax to define a new variable in JavaScript: var firstname;
  • 15. Identifiers • JavaScript identifiers are the names of variables and functions. • Identifiers cannot be the same as keywords already used in JavaScript. • For example, ―if ‖ has a special meaning in JavaScript statements and is not available as a variable name.
  • 16. JavaScript Libraries • A library is collection of resources, like pre-written function code and subroutines, that developers use to create programs. • A JavaScript library is pre-written JavaScript code. • jQuery is the leading JavaScript library. • Other popular libraries include Dojo, MooTools, and YUI.
  • 17. JavaScript Libraries (Continued) • When using a third-party library, include an element such as the following to reference the library: <script type = "text/javascript" src = "web or local address of the JavaScript library source"></script>
  • 18. getElementById() Method • One important way to access display elements is with the getElementById() method. • This method returns a reference to the first object with the specified id or NAME attribute.
  • 20. Methods • Methods are JavaScript functions that belong to objects. • Methods differ from functions in that methods are always associated and used with a particular object. • isNaN() is an example of a JavaScript function. – Tests for ―not a number‖; if value = 0 (false), value is a number • document.getElementById() is an example of a JavaScript method; you can effectively only use getElementById with the special document object.
  • 21. Events • Events are actions that trigger other actions to occur. • An event handler is an optional script or executable that handles input received in a program. Handlers are JavaScript code inside the <html> tags (rather than the <script> tags) that execute other JavaScript code in response to an event.
  • 22. Events (Continued) • A callback is a response to an event, such as a script execution in response to a mouse click.
  • 23. onLoad Event Handler • The onLoad event handler ―belongs‖ to HTML items; it triggers when its owner is complete. • The onLoad for an <img> image occurs when the image is fully rendered and visible. • The onLoad for a <table> fires once all the cells in that table have been drawn.
  • 26. Flawed JavaScript Programs Are Erratic • Flawed JavaScript programs are erratic— they give different results at different times. • Reasons: – If the program depends on the existence of a particular screen element but doesn’t assure that the element exists – Launching the program at different times, resulting in slightly different loading order • Fix: Begin calculations only after onLoad has fired.
  • 27. Showing and Hiding Elements • The HTML display attribute shows the user pertinent information and hides the information when no longer needed.
  • 29. HTML display Attribute Example (Cont.)
  • 30. Updating the Content of Elements • JavaScript uses the innerHTML property to change the current content of HTML elements (referred to as ―inner content‖) or insert new content.
  • 33. Recap • Introduction to JavaScript – Alert boxes – JavaScript statements • • • • • • • • • • Creating a simple JavaScript application Functions Links between HTML and JavaScript Variables Identifiers JavaScript libraries Methods Events Showing and hiding elements Updating the content of elements

Editor's Notes

  • #3: Tip: Add your own speaker notes here.
  • #4: Tip: Add your own speaker notes here.
  • #5: Tip: Add your own speaker notes here.
  • #6: Tip: Add your own speaker notes here.
  • #7: Tip: Add your own speaker notes here.
  • #8: Tip: Add your own speaker notes here.
  • #9: Tip: Add your own speaker notes here.
  • #10: Tip: Add your own speaker notes here.
  • #11: Tip: Add your own speaker notes here.
  • #12: Tip: Add your own speaker notes here.
  • #13: Tip: Add your own speaker notes here.
  • #14: Tip: Add your own speaker notes here.
  • #15: Tip: Add your own speaker notes here.
  • #16: Tip: Add your own speaker notes here.
  • #17: Tip: Add your own speaker notes here.
  • #18: Tip: Add your own speaker notes here.
  • #19: Tip: Add your own speaker notes here.
  • #20: Tip: Add your own speaker notes here.
  • #21: Tip: Add your own speaker notes here.
  • #22: Tip: Add your own speaker notes here.
  • #23: Tip: Add your own speaker notes here.
  • #24: Tip: Add your own speaker notes here.
  • #25: Tip: Add your own speaker notes here.
  • #26: Tip: Add your own speaker notes here.
  • #27: Tip: Add your own speaker notes here.
  • #28: Tip: Add your own speaker notes here.
  • #29: Tip: Add your own speaker notes here.
  • #30: Tip: Add your own speaker notes here.
  • #31: Tip: Add your own speaker notes here.
  • #32: Tip: Add your own speaker notes here.
  • #33: Tip: Add your own speaker notes here.