SlideShare a Scribd company logo
1 of 18
Download to read offline
CHAPTER 01: Lesson 6
Darwin Alvin I. Sunga
At the end of this chapter, the students should able to :
1. Javascript
✓ What is JavaScript
✓ Why/how to use
✓ Comments
✓ Outputs
✓ Functions and Events
What is a
JavaScript (JS)?
JavaScript is a programming language commonly used in web development. It was
originally developed by Netscape as a means to add dynamic and interactive
elements to websites. While JavaScript is influenced by Java, the syntax is more similar to
C and is based on ECMAScript, a scripting language developed by Sun Microsystems.
https://techterms.com/definition/javascript
JavaScript is a client-side scripting language, which means the source code is processed by
the client's web browser rather than on the web server. This means JavaScript functions can run
after a webpage has loaded without communicating with the server.
For example, a JavaScript function may check a web form before it is submitted to make sure
all the required fields have been filled out. The JavaScript code can produce an error message
before any information is actually transmitted to the server.
JavaScript and Java are completely different languages, both in concept and design.
JavaScript was invented by Brendan Eich in 1995, and became an ECMA standard in 1997.
ECMA-262 is the official name of the standard. ECMAScript is the official name of the
language.
Did You Know?
https://www.w3schools.com/js/js_intro.asp && https://www.hackreactor.com/blog/what-is-javascript-used-for
Why use JavaScript?
1) Adding interactive behavior to web pages
(a) how or hide more information with the click of a button b) change the color of a button when the mouse hovers over it c) slide
through a carousel of images on the homepage d) zooming in or zooming out on an image e) Displaying a timer or count-down on a
website f) Playing audio and video in a web page g) Displaying animations h)Using a drop-down hamburger menu)
2) Creating web and mobile apps
Popular JavaScript front-end frameworks include React, React Native, Angular, and Vue. Many companies use Node.js, a JavaScript
runtime environment built on Google Chrome’s JavaScript V8 engine. A few famous examples include Paypal, LinkedIn, Netflix, and
Uber!
3) Building web servers and developing server applications
Beyond websites and apps, developers can also use JavaScript to build simple web servers and develop the back-end infrastructure
using Node.js.
4) Game development
JavaScript to create browser games
The <script> Tag
Javascript where to?
https://www.w3schools.com/js/js_whereto.asp
In HTML, JavaScript code is inserted between <script> and </script> tags.
Did you know :
Old JavaScript examples may use a type attribute: <script language = “javascript” type="text/javascript">.
The type attribute is not required. JavaScript is the default scripting language in HTML.
1) JavaScript in <head> or <body>
You can place any number of scripts in an HTML document.
Scripts can be placed in the <body>, or in the <head> section of an HTML page, or in both.
Note : Placing scripts at the bottom of the <body> element improves the display speed, because script
interpretation slows down the display.
2) External JavaScript
External scripts are practical when the same code is used in many different web pages.
JavaScript files have the file extension .js.
To use an external script, put the name of the script file in the src (source) attribute of a <script> tag:
Note: External scripts cannot contain <script> tags.
JavaScript Comments
https://www.w3schools.com/js/js_comments.asp
JavaScript comments can be used to explain JavaScript code, and to make it more readable.
JavaScript comments can also be used to prevent execution, when testing alternative code.
Single Line Comments
Single line comments start with //.
Any text between // and the end of the line will be ignored by JavaScript (will not be executed).
Multi-line Comments
Multi-line comments start with /* and end with */.
Any text between /* and */ will be ignored by JavaScript.
JavaScript Display Possibilities
https://www.w3schools.com/js/js_output.asp
JavaScript can "display" data in different ways:
❑ Writing into an HTML element, using innerHTML.
❑ Writing into the HTML output using document.write().
❑ Writing into an alert box, using window.alert().
❑ Writing into the browser console, using console.log().
JavaScript Display Possibilities
https://www.w3schools.com/js/js_output.asp
JavaScript can "display" data in different ways:
❑ Using innerHTML
To access an HTML element, JavaScript can use the document.getElementById(id) method.
The id attribute defines the HTML element. The innerHTML property defines the HTML content:
JavaScript Display Possibilities
https://www.w3schools.com/js/js_output.asp
JavaScript can "display" data in different ways:
❑ Using document.write()
For testing purposes, it is convenient to use document.write():
Note :
The document.write() method should only be used for testing
Using document.write() after an HTML document is loaded, will delete all existing HTML:
JavaScript Display Possibilities
https://www.w3schools.com/js/js_output.asp
JavaScript can "display" data in different ways:
❑ Using window.alert()
You can use an alert box to display data:
Note :
You can skip the window keyword. In JavaScript, the window object is the global scope object,
that means that variables, properties, and methods by default belong to the window object.
This also means that specifying the window keyword is optional:
JavaScript Display Possibilities
https://www.w3schools.com/js/js_output.asp
JavaScript can "display" data in different ways:
❑ Using console.log()
For debugging purposes, you can call the console.log() method in the browser to display data.
JavaScript Functions and Events
https://www.w3schools.com/js/js_functions.asp
A JavaScript function is a block of JavaScript code, that can be executed when "called" for.
For example, a function can be called when an event occurs, like when the user clicks a button.
JavaScript Function Syntax
A JavaScript function is defined with the…
- function keyword, followed by a name, followed by parentheses ().
▪ Function names can contain letters, digits, underscores, and dollar signs.
▪ The parentheses may include parameter names separated by commas:
(parameter1, parameter2, ...)
▪ The code to be executed, by the function, is placed inside curly brackets: {}
Why Functions?
You can reuse code: Define the code once, and use it many times.
You can use the same code many times with different arguments, to produce different results.
JavaScript Functions and Events
https://www.w3schools.com/js/js_events.asp
HTML events are "things" that happen to HTML elements.
When JavaScript is used in HTML pages, JavaScript can "react" on these events.
HTML Events
An HTML event can be something the browser does, or something a user does.
Here are some examples of HTML events:
▪ An HTML web page has finished loading
▪ An HTML input field was changed
▪ An HTML button was clicked
Common HTML Events (input , mouse, load)
https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onchange
HTML DOM Events.
https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onclick
For more info visit :
https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onmouseover
https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onmouseover
https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onkeydown
https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onload
EXAMPLES
JavaScript Example
https://www.w3schools.com/js/js_input_examples.asp
1) Change HTML Content
2) Change HTML Attributes
3) Change CSS Style
4) Hide/Show Elements
5) Disable button
6) Submit/ Reset a Form
7) Open/Close New Window
8) Print Page
9) Display Confirm Box
10) Timing
https://www.w3schools.com/js/tryit.asp?filename=tryjs_button_disabled
https://www.w3schools.com/js/tryit.asp?filename=tryjs_form_submit
https://www.w3schools.com/js/tryit.asp?filename=tryjs_intro_inner_html
https://www.w3schools.com/js/tryit.asp?filename=tryjs_intro_lightbulb
https://www.w3schools.com/js/tryit.asp?filename=tryjs_intro_style
https://www.w3schools.com/js/tryit.asp?filename=tryjs_intro_hide
https://www.w3schools.com/js/tryit.asp?filename=tryjs_win_close
https://www.w3schools.com/js/tryit.asp?filename=tryjs_print
https://www.w3schools.com/js/tryit.asp?filename=tryjs_confirm
https://www.w3schools.com/js/tryit.asp?filename=tryjs_timing1
Advance Lesson :
1. Php
8.-Javascript-report powerpoint presentation

More Related Content

Similar to 8.-Javascript-report powerpoint presentation

Similar to 8.-Javascript-report powerpoint presentation (20)

Javascript tutorial
Javascript tutorialJavascript tutorial
Javascript tutorial
 
JavaScript Core fundamentals - Learn JavaScript Here
JavaScript Core fundamentals - Learn JavaScript HereJavaScript Core fundamentals - Learn JavaScript Here
JavaScript Core fundamentals - Learn JavaScript Here
 
JavaScript - Chapter 3 - Introduction
 JavaScript - Chapter 3 - Introduction JavaScript - Chapter 3 - Introduction
JavaScript - Chapter 3 - Introduction
 
JAVA SCRIPT
JAVA SCRIPTJAVA SCRIPT
JAVA SCRIPT
 
Java script Basic
Java script BasicJava script Basic
Java script Basic
 
Basic Java script handouts for students
Basic Java script handouts for students Basic Java script handouts for students
Basic Java script handouts for students
 
Java script by Act Academy
Java script by Act AcademyJava script by Act Academy
Java script by Act Academy
 
Unit 4(it workshop)
Unit 4(it workshop)Unit 4(it workshop)
Unit 4(it workshop)
 
Iwt note(module 2)
Iwt note(module 2)Iwt note(module 2)
Iwt note(module 2)
 
Basics java scripts
Basics java scriptsBasics java scripts
Basics java scripts
 
06 Javascript
06 Javascript06 Javascript
06 Javascript
 
Web programming UNIT II by Bhavsingh Maloth
Web programming UNIT II by Bhavsingh MalothWeb programming UNIT II by Bhavsingh Maloth
Web programming UNIT II by Bhavsingh Maloth
 
WEB PROGRAMMING UNIT II BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT II BY BHAVSINGH MALOTHWEB PROGRAMMING UNIT II BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT II BY BHAVSINGH MALOTH
 
WEB TECHNOLOGIES JavaScript
WEB TECHNOLOGIES JavaScriptWEB TECHNOLOGIES JavaScript
WEB TECHNOLOGIES JavaScript
 
WEB MODULE 3.pdf
WEB MODULE 3.pdfWEB MODULE 3.pdf
WEB MODULE 3.pdf
 
Javascript
JavascriptJavascript
Javascript
 
js.pptx
js.pptxjs.pptx
js.pptx
 
Javascript tutorial
Javascript tutorialJavascript tutorial
Javascript tutorial
 
Java script
Java scriptJava script
Java script
 
JS BASICS JAVA SCRIPT SCRIPTING
JS BASICS JAVA SCRIPT SCRIPTINGJS BASICS JAVA SCRIPT SCRIPTING
JS BASICS JAVA SCRIPT SCRIPTING
 

More from JohnLagman3

7.-Bootstrap-5-report powerpoint presentation
7.-Bootstrap-5-report powerpoint presentation7.-Bootstrap-5-report powerpoint presentation
7.-Bootstrap-5-report powerpoint presentationJohnLagman3
 
1._Introduction_to_HTML5 powerpoint presentation
1._Introduction_to_HTML5 powerpoint presentation1._Introduction_to_HTML5 powerpoint presentation
1._Introduction_to_HTML5 powerpoint presentationJohnLagman3
 
bufferoverflow-151214121251 presentation
bufferoverflow-151214121251 presentationbufferoverflow-151214121251 presentation
bufferoverflow-151214121251 presentationJohnLagman3
 
Variables in MIT App Inventor powerpoint
Variables in MIT App Inventor powerpointVariables in MIT App Inventor powerpoint
Variables in MIT App Inventor powerpointJohnLagman3
 
Web-Development Powerpoint Presentation.
Web-Development Powerpoint Presentation.Web-Development Powerpoint Presentation.
Web-Development Powerpoint Presentation.JohnLagman3
 
History of Android powerpoint presentation
History of Android powerpoint presentationHistory of Android powerpoint presentation
History of Android powerpoint presentationJohnLagman3
 
Mobile Application Development powerpoint
Mobile Application Development powerpointMobile Application Development powerpoint
Mobile Application Development powerpointJohnLagman3
 
Presentation of Hyper Text Markup Language
Presentation of Hyper Text Markup LanguagePresentation of Hyper Text Markup Language
Presentation of Hyper Text Markup LanguageJohnLagman3
 
html-150424090224-conversion-gate0.2.pdf
html-150424090224-conversion-gate0.2.pdfhtml-150424090224-conversion-gate0.2.pdf
html-150424090224-conversion-gate0.2.pdfJohnLagman3
 
Hypertext Mark Up Language Introduction.
Hypertext Mark Up Language Introduction.Hypertext Mark Up Language Introduction.
Hypertext Mark Up Language Introduction.JohnLagman3
 
Multiple_Linear_Regression Presentation.
Multiple_Linear_Regression Presentation.Multiple_Linear_Regression Presentation.
Multiple_Linear_Regression Presentation.JohnLagman3
 
Lesson 4 - Introduction to Filmora.pptx
Lesson 4 - Introduction to Filmora.pptxLesson 4 - Introduction to Filmora.pptx
Lesson 4 - Introduction to Filmora.pptxJohnLagman3
 
1.-Introduction-report.pdf
1.-Introduction-report.pdf1.-Introduction-report.pdf
1.-Introduction-report.pdfJohnLagman3
 
Lesson 1 Animation.pdf
Lesson 1 Animation.pdfLesson 1 Animation.pdf
Lesson 1 Animation.pdfJohnLagman3
 
Confidentiality Privacy and Security.ppt
Confidentiality Privacy and Security.pptConfidentiality Privacy and Security.ppt
Confidentiality Privacy and Security.pptJohnLagman3
 
physicalsecurity-150317020111-conversion-gate01.pdf
physicalsecurity-150317020111-conversion-gate01.pdfphysicalsecurity-150317020111-conversion-gate01.pdf
physicalsecurity-150317020111-conversion-gate01.pdfJohnLagman3
 
Introduction to BIOMETRICS Security.pptx
Introduction to BIOMETRICS Security.pptxIntroduction to BIOMETRICS Security.pptx
Introduction to BIOMETRICS Security.pptxJohnLagman3
 
1.-Introduction-report.pptx
1.-Introduction-report.pptx1.-Introduction-report.pptx
1.-Introduction-report.pptxJohnLagman3
 
ORIENTATION-CIS.pdf
ORIENTATION-CIS.pdfORIENTATION-CIS.pdf
ORIENTATION-CIS.pdfJohnLagman3
 

More from JohnLagman3 (20)

7.-Bootstrap-5-report powerpoint presentation
7.-Bootstrap-5-report powerpoint presentation7.-Bootstrap-5-report powerpoint presentation
7.-Bootstrap-5-report powerpoint presentation
 
1._Introduction_to_HTML5 powerpoint presentation
1._Introduction_to_HTML5 powerpoint presentation1._Introduction_to_HTML5 powerpoint presentation
1._Introduction_to_HTML5 powerpoint presentation
 
bufferoverflow-151214121251 presentation
bufferoverflow-151214121251 presentationbufferoverflow-151214121251 presentation
bufferoverflow-151214121251 presentation
 
Variables in MIT App Inventor powerpoint
Variables in MIT App Inventor powerpointVariables in MIT App Inventor powerpoint
Variables in MIT App Inventor powerpoint
 
Web-Development Powerpoint Presentation.
Web-Development Powerpoint Presentation.Web-Development Powerpoint Presentation.
Web-Development Powerpoint Presentation.
 
History of Android powerpoint presentation
History of Android powerpoint presentationHistory of Android powerpoint presentation
History of Android powerpoint presentation
 
Mobile Application Development powerpoint
Mobile Application Development powerpointMobile Application Development powerpoint
Mobile Application Development powerpoint
 
Presentation of Hyper Text Markup Language
Presentation of Hyper Text Markup LanguagePresentation of Hyper Text Markup Language
Presentation of Hyper Text Markup Language
 
html-150424090224-conversion-gate0.2.pdf
html-150424090224-conversion-gate0.2.pdfhtml-150424090224-conversion-gate0.2.pdf
html-150424090224-conversion-gate0.2.pdf
 
Hypertext Mark Up Language Introduction.
Hypertext Mark Up Language Introduction.Hypertext Mark Up Language Introduction.
Hypertext Mark Up Language Introduction.
 
Multiple_Linear_Regression Presentation.
Multiple_Linear_Regression Presentation.Multiple_Linear_Regression Presentation.
Multiple_Linear_Regression Presentation.
 
Lesson 4 - Introduction to Filmora.pptx
Lesson 4 - Introduction to Filmora.pptxLesson 4 - Introduction to Filmora.pptx
Lesson 4 - Introduction to Filmora.pptx
 
1.-Introduction-report.pdf
1.-Introduction-report.pdf1.-Introduction-report.pdf
1.-Introduction-report.pdf
 
Lesson 1 Animation.pdf
Lesson 1 Animation.pdfLesson 1 Animation.pdf
Lesson 1 Animation.pdf
 
Lesson 1.pdf
Lesson 1.pdfLesson 1.pdf
Lesson 1.pdf
 
Confidentiality Privacy and Security.ppt
Confidentiality Privacy and Security.pptConfidentiality Privacy and Security.ppt
Confidentiality Privacy and Security.ppt
 
physicalsecurity-150317020111-conversion-gate01.pdf
physicalsecurity-150317020111-conversion-gate01.pdfphysicalsecurity-150317020111-conversion-gate01.pdf
physicalsecurity-150317020111-conversion-gate01.pdf
 
Introduction to BIOMETRICS Security.pptx
Introduction to BIOMETRICS Security.pptxIntroduction to BIOMETRICS Security.pptx
Introduction to BIOMETRICS Security.pptx
 
1.-Introduction-report.pptx
1.-Introduction-report.pptx1.-Introduction-report.pptx
1.-Introduction-report.pptx
 
ORIENTATION-CIS.pdf
ORIENTATION-CIS.pdfORIENTATION-CIS.pdf
ORIENTATION-CIS.pdf
 

Recently uploaded

ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.arsicmarija21
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
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
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
Planning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxPlanning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxLigayaBacuel1
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
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
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 

Recently uploaded (20)

ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.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
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
Planning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxPlanning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptx
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.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
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
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
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 

8.-Javascript-report powerpoint presentation

  • 1. CHAPTER 01: Lesson 6 Darwin Alvin I. Sunga
  • 2. At the end of this chapter, the students should able to : 1. Javascript ✓ What is JavaScript ✓ Why/how to use ✓ Comments ✓ Outputs ✓ Functions and Events
  • 3. What is a JavaScript (JS)? JavaScript is a programming language commonly used in web development. It was originally developed by Netscape as a means to add dynamic and interactive elements to websites. While JavaScript is influenced by Java, the syntax is more similar to C and is based on ECMAScript, a scripting language developed by Sun Microsystems. https://techterms.com/definition/javascript JavaScript is a client-side scripting language, which means the source code is processed by the client's web browser rather than on the web server. This means JavaScript functions can run after a webpage has loaded without communicating with the server. For example, a JavaScript function may check a web form before it is submitted to make sure all the required fields have been filled out. The JavaScript code can produce an error message before any information is actually transmitted to the server.
  • 4. JavaScript and Java are completely different languages, both in concept and design. JavaScript was invented by Brendan Eich in 1995, and became an ECMA standard in 1997. ECMA-262 is the official name of the standard. ECMAScript is the official name of the language. Did You Know? https://www.w3schools.com/js/js_intro.asp && https://www.hackreactor.com/blog/what-is-javascript-used-for Why use JavaScript? 1) Adding interactive behavior to web pages (a) how or hide more information with the click of a button b) change the color of a button when the mouse hovers over it c) slide through a carousel of images on the homepage d) zooming in or zooming out on an image e) Displaying a timer or count-down on a website f) Playing audio and video in a web page g) Displaying animations h)Using a drop-down hamburger menu) 2) Creating web and mobile apps Popular JavaScript front-end frameworks include React, React Native, Angular, and Vue. Many companies use Node.js, a JavaScript runtime environment built on Google Chrome’s JavaScript V8 engine. A few famous examples include Paypal, LinkedIn, Netflix, and Uber! 3) Building web servers and developing server applications Beyond websites and apps, developers can also use JavaScript to build simple web servers and develop the back-end infrastructure using Node.js. 4) Game development JavaScript to create browser games
  • 5. The <script> Tag Javascript where to? https://www.w3schools.com/js/js_whereto.asp In HTML, JavaScript code is inserted between <script> and </script> tags. Did you know : Old JavaScript examples may use a type attribute: <script language = “javascript” type="text/javascript">. The type attribute is not required. JavaScript is the default scripting language in HTML. 1) JavaScript in <head> or <body> You can place any number of scripts in an HTML document. Scripts can be placed in the <body>, or in the <head> section of an HTML page, or in both. Note : Placing scripts at the bottom of the <body> element improves the display speed, because script interpretation slows down the display. 2) External JavaScript External scripts are practical when the same code is used in many different web pages. JavaScript files have the file extension .js. To use an external script, put the name of the script file in the src (source) attribute of a <script> tag: Note: External scripts cannot contain <script> tags.
  • 6. JavaScript Comments https://www.w3schools.com/js/js_comments.asp JavaScript comments can be used to explain JavaScript code, and to make it more readable. JavaScript comments can also be used to prevent execution, when testing alternative code. Single Line Comments Single line comments start with //. Any text between // and the end of the line will be ignored by JavaScript (will not be executed). Multi-line Comments Multi-line comments start with /* and end with */. Any text between /* and */ will be ignored by JavaScript.
  • 7. JavaScript Display Possibilities https://www.w3schools.com/js/js_output.asp JavaScript can "display" data in different ways: ❑ Writing into an HTML element, using innerHTML. ❑ Writing into the HTML output using document.write(). ❑ Writing into an alert box, using window.alert(). ❑ Writing into the browser console, using console.log().
  • 8. JavaScript Display Possibilities https://www.w3schools.com/js/js_output.asp JavaScript can "display" data in different ways: ❑ Using innerHTML To access an HTML element, JavaScript can use the document.getElementById(id) method. The id attribute defines the HTML element. The innerHTML property defines the HTML content:
  • 9. JavaScript Display Possibilities https://www.w3schools.com/js/js_output.asp JavaScript can "display" data in different ways: ❑ Using document.write() For testing purposes, it is convenient to use document.write(): Note : The document.write() method should only be used for testing Using document.write() after an HTML document is loaded, will delete all existing HTML:
  • 10. JavaScript Display Possibilities https://www.w3schools.com/js/js_output.asp JavaScript can "display" data in different ways: ❑ Using window.alert() You can use an alert box to display data: Note : You can skip the window keyword. In JavaScript, the window object is the global scope object, that means that variables, properties, and methods by default belong to the window object. This also means that specifying the window keyword is optional:
  • 11. JavaScript Display Possibilities https://www.w3schools.com/js/js_output.asp JavaScript can "display" data in different ways: ❑ Using console.log() For debugging purposes, you can call the console.log() method in the browser to display data.
  • 12. JavaScript Functions and Events https://www.w3schools.com/js/js_functions.asp A JavaScript function is a block of JavaScript code, that can be executed when "called" for. For example, a function can be called when an event occurs, like when the user clicks a button. JavaScript Function Syntax A JavaScript function is defined with the… - function keyword, followed by a name, followed by parentheses (). ▪ Function names can contain letters, digits, underscores, and dollar signs. ▪ The parentheses may include parameter names separated by commas: (parameter1, parameter2, ...) ▪ The code to be executed, by the function, is placed inside curly brackets: {} Why Functions? You can reuse code: Define the code once, and use it many times. You can use the same code many times with different arguments, to produce different results.
  • 13. JavaScript Functions and Events https://www.w3schools.com/js/js_events.asp HTML events are "things" that happen to HTML elements. When JavaScript is used in HTML pages, JavaScript can "react" on these events. HTML Events An HTML event can be something the browser does, or something a user does. Here are some examples of HTML events: ▪ An HTML web page has finished loading ▪ An HTML input field was changed ▪ An HTML button was clicked Common HTML Events (input , mouse, load) https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onchange HTML DOM Events. https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onclick For more info visit : https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onmouseover https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onmouseover https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onkeydown https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onload
  • 15. JavaScript Example https://www.w3schools.com/js/js_input_examples.asp 1) Change HTML Content 2) Change HTML Attributes 3) Change CSS Style 4) Hide/Show Elements 5) Disable button 6) Submit/ Reset a Form 7) Open/Close New Window 8) Print Page 9) Display Confirm Box 10) Timing https://www.w3schools.com/js/tryit.asp?filename=tryjs_button_disabled https://www.w3schools.com/js/tryit.asp?filename=tryjs_form_submit https://www.w3schools.com/js/tryit.asp?filename=tryjs_intro_inner_html https://www.w3schools.com/js/tryit.asp?filename=tryjs_intro_lightbulb https://www.w3schools.com/js/tryit.asp?filename=tryjs_intro_style https://www.w3schools.com/js/tryit.asp?filename=tryjs_intro_hide https://www.w3schools.com/js/tryit.asp?filename=tryjs_win_close https://www.w3schools.com/js/tryit.asp?filename=tryjs_print https://www.w3schools.com/js/tryit.asp?filename=tryjs_confirm https://www.w3schools.com/js/tryit.asp?filename=tryjs_timing1
  • 16.