SlideShare a Scribd company logo
JavaScript
www.PracticalCoding.inwww.PracticalCoding.in
A little Background
➢ JavaScript isn’t JAVA
➢ Developed by Brendan Eich at Netscape
➢ Was called LiveScript
➢ Not a compiled language
➢ Case sensitive :
function oneDrive() is different from function OneDrive()
www.PracticalCoding.inwww.PracticalCoding.in
What’s in a JavaScript Program?
Statements formed from tokens, operators, and identifiers placed
together in an order that is meaningful to a JavaScript interpreter,
which is contained in most web browsers.
www.PracticalCoding.inwww.PracticalCoding.in
Where should I write it ?
➢ <head>...</head>
➢ <body>...</body>
➢ External file included in the HTML file
<html>
<head>
<title>A Web Page Title</title>
<script type="text/javascript">
// JavaScript Goes Here
</script>
<script type="text/javascript" src="myscript.js">
</head>
<body>
<script type="text/javascript">
// JavaScript can go here too
</script>
</body>
</html>
www.PracticalCoding.inwww.PracticalCoding.in
Comments
➢/* This is a multiline
comment */
➢// This is a single line comment
www.PracticalCoding.inwww.PracticalCoding.in
Keywords
www.PracticalCoding.inwww.PracticalCoding.in
Data types
➢Numbers
➢Strings
➢Booleans
➢Null (Empty is not Null)
➢undefined
➢Objects
www.PracticalCoding.inwww.PracticalCoding.in
Math object
➢Math.Random()
➢Math.abs(x)
➢Math.pow(x,y)
➢Math.round(x)
www.PracticalCoding.inwww.PracticalCoding.in
Strings
Open firebug, type a string and explore the
methods available
www.PracticalCoding.inwww.PracticalCoding.in
Date object
Open firebug and explore
www.PracticalCoding.inwww.PracticalCoding.in
For loops
for (var i = 0; i < 1000; i++) {
//do something
)
www.PracticalCoding.inwww.PracticalCoding.in
Operators
➢ Additive operators ( +/- )
➢ Multiplicative operators ( *, /)
➢ Bitwise operators (&,|,^,!,<<,>>,>>>)
➢ Equality operators (==,!=,===,!==)
➢ Relational operators (<,>,>=,<=,in, instanceof)
➢ Unary operators(delete,void,typeof,++,--,+,-,!,~)
➢ Assignment operators
www.PracticalCoding.inwww.PracticalCoding.in
Controlling flow with conditionals and loops
➢ if else conditional statement and ternary operations
➢ switch statement
➢ while loop and a do...while loop
➢ for loops (general, for..each and for..in)
www.PracticalCoding.inwww.PracticalCoding.in
Functions
<script type="text/javascript">
function myFunction() {
var firstArg = arguments[0];
var secondArg = arguments[1];
alert("firstArg is: " + firstArg);
alert("secondArg is: " + secondArg);
}
myFunction("hello","world");
</script>
www.PracticalCoding.inwww.PracticalCoding.in
Function literal
JavaScript does not require functions to be
defined formally.
www.PracticalCoding.inwww.PracticalCoding.in
Objects
Properties
Methods
and whats this ?
www.PracticalCoding.inwww.PracticalCoding.in
Arrays
➢ Creation
➢ Methods
➢ Copying arrays
➢ push() and pop()
➢ Iterating through arrays using for()
Explore arrays in Firebug !
www.PracticalCoding.inwww.PracticalCoding.in
Timers
➢ setInterval()
➢ clearInterval()
➢ setTimeout()
➢ clearTimeout()
www.PracticalCoding.inwww.PracticalCoding.in
Window object
➢ document
➢ frames
➢ history
➢ location
➢ navigator
➢ screen
➢ self/window/parent
www.PracticalCoding.inwww.PracticalCoding.in
Observing the built in properties and methods
var body = document.getElementsByTagName("body")[0];
for (var prop in navigator) {
var elem = document.createElement("p");
var text = document.createTextNode(prop + ": " +
navigator[prop]);
elem.appendChild(text);
body.appendChild(elem);
}
Replace the ‘navigator’ with other objects to check.
www.PracticalCoding.inwww.PracticalCoding.in
Tree structure of DOM
www.PracticalCoding.inwww.PracticalCoding.in
Retrieving Elements
➢getElementById()
➢innerHTML
➢getElementsByTagName()
www.PracticalCoding.inwww.PracticalCoding.in
HTML Collections
➢document.anchors (requires ‘name’)
➢document.forms
➢document.images
➢document.links(requires ‘href’)
www.PracticalCoding.inwww.PracticalCoding.in
Siblings and Children
➢ .childNodes[0]
➢ nextSibling
➢ previousSibling
➢ firstChild
➢ lastChild
www.PracticalCoding.inwww.PracticalCoding.in
Events
onblur() The element lost focus (that is, it is not selected by the user).
onchange() The element has either changed (for example, a user typed into a text field) or lost focus.
onclick() The mouse clicked an element.
ondblclick() The mouse double-clicked an element.
onfocus() The element got focus.
onkeydown() A keyboard key is pressed (as opposed to released) while the element has focus.
onkeypress() A keyboard key is pressed while the element has focus.
onkeyup() A keyboard key is released while the element has focus.
onload() The element is loaded (a document, a frameset, or an image).
onmousedown() A mouse button is pressed.
onmousemove() The mouse is moved.
onmouseout() The mouse is moved off of or away from an element.
onmouseover() The mouse is over an element.
onmouseup() A mouse button is released.
onreset() The form element is reset, such as when a user presses a form reset button.
onresize() The window’s size is changed.
onselect() The text of a form element is selected.
onsubmit() The form is submitted.
onunload() The document or frameset is unloaded.
www.PracticalCoding.inwww.PracticalCoding.in
Learn More
@
www.PracticalCoding.in

More Related Content

What's hot (20)

Introduction to Java Script
Introduction to Java ScriptIntroduction to Java Script
Introduction to Java Script
Vijay Kumar Verma
 
Java script by Act Academy
Java script by Act AcademyJava script by Act Academy
Java script by Act Academy
actanimation
 
JavaScript
JavaScriptJavaScript
JavaScript
Doncho Minkov
 
Java Script
Java ScriptJava Script
Java Script
Dr. SURBHI SAROHA
 
22 j query1
22 j query122 j query1
22 j query1
Fajar Baskoro
 
10 java script projects full source code
10 java script projects full source code10 java script projects full source code
10 java script projects full source code
Laurence Svekis ✔
 
Node.js Crash Course (Jump Start)
Node.js Crash Course (Jump Start) Node.js Crash Course (Jump Start)
Node.js Crash Course (Jump Start)
Haim Michael
 
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
Ayes Chinmay
 
Interacting with the DOM (JavaScript)
Interacting with the DOM (JavaScript)Interacting with the DOM (JavaScript)
Interacting with the DOM (JavaScript)
Florence Davis
 
Introduction to html & css
Introduction to html & cssIntroduction to html & css
Introduction to html & css
sesharao puvvada
 
JavaScript & Dom Manipulation
JavaScript & Dom ManipulationJavaScript & Dom Manipulation
JavaScript & Dom Manipulation
Mohammed Arif
 
Java script writing javascript
Java script writing javascriptJava script writing javascript
Java script writing javascript
Jesus Obenita Jr.
 
Java script session 3
Java script session 3Java script session 3
Java script session 3
Saif Ullah Dar
 
Java script
Java scriptJava script
Java script
Fajar Baskoro
 
1 ppt-ajax with-j_query
1 ppt-ajax with-j_query1 ppt-ajax with-j_query
1 ppt-ajax with-j_query
Fajar Baskoro
 
Javascript inside Browser (DOM)
Javascript inside Browser (DOM)Javascript inside Browser (DOM)
Javascript inside Browser (DOM)
Vlad Mysla
 
Javascript projects Course
Javascript projects CourseJavascript projects Course
Javascript projects Course
Laurence Svekis ✔
 
Web Components
Web ComponentsWeb Components
Web Components
Nikolaus Graf
 
JavaScript DOM - Dynamic interactive Code
JavaScript DOM - Dynamic interactive CodeJavaScript DOM - Dynamic interactive Code
JavaScript DOM - Dynamic interactive Code
Laurence Svekis ✔
 
JavaScript and BOM events
JavaScript and BOM eventsJavaScript and BOM events
JavaScript and BOM events
Jussi Pohjolainen
 
Java script by Act Academy
Java script by Act AcademyJava script by Act Academy
Java script by Act Academy
actanimation
 
10 java script projects full source code
10 java script projects full source code10 java script projects full source code
10 java script projects full source code
Laurence Svekis ✔
 
Node.js Crash Course (Jump Start)
Node.js Crash Course (Jump Start) Node.js Crash Course (Jump Start)
Node.js Crash Course (Jump Start)
Haim Michael
 
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
Ayes Chinmay
 
Interacting with the DOM (JavaScript)
Interacting with the DOM (JavaScript)Interacting with the DOM (JavaScript)
Interacting with the DOM (JavaScript)
Florence Davis
 
Introduction to html & css
Introduction to html & cssIntroduction to html & css
Introduction to html & css
sesharao puvvada
 
JavaScript & Dom Manipulation
JavaScript & Dom ManipulationJavaScript & Dom Manipulation
JavaScript & Dom Manipulation
Mohammed Arif
 
Java script writing javascript
Java script writing javascriptJava script writing javascript
Java script writing javascript
Jesus Obenita Jr.
 
1 ppt-ajax with-j_query
1 ppt-ajax with-j_query1 ppt-ajax with-j_query
1 ppt-ajax with-j_query
Fajar Baskoro
 
Javascript inside Browser (DOM)
Javascript inside Browser (DOM)Javascript inside Browser (DOM)
Javascript inside Browser (DOM)
Vlad Mysla
 
JavaScript DOM - Dynamic interactive Code
JavaScript DOM - Dynamic interactive CodeJavaScript DOM - Dynamic interactive Code
JavaScript DOM - Dynamic interactive Code
Laurence Svekis ✔
 

Viewers also liked (15)

Pinned Sites IE 9 Lightup
Pinned Sites IE 9 LightupPinned Sites IE 9 Lightup
Pinned Sites IE 9 Lightup
Wes Yanaga
 
Windows Phone 7 Unleashed Session 2
Windows Phone 7 Unleashed Session 2Windows Phone 7 Unleashed Session 2
Windows Phone 7 Unleashed Session 2
Wes Yanaga
 
Windows Phone 7 Unleashed Session 1
Windows Phone 7 Unleashed Session 1Windows Phone 7 Unleashed Session 1
Windows Phone 7 Unleashed Session 1
Wes Yanaga
 
JungPumpen_Brochure-912010
JungPumpen_Brochure-912010JungPumpen_Brochure-912010
JungPumpen_Brochure-912010
Lisa Gabrish
 
Presentacion profesional
Presentacion profesionalPresentacion profesional
Presentacion profesional
Cruzcamalab
 
Ying's Portfolio 2016
Ying's Portfolio 2016Ying's Portfolio 2016
Ying's Portfolio 2016
Calvin Cheung
 
Reclamacion
ReclamacionReclamacion
Reclamacion
Jake Rayo
 
buscador ninesky
buscador nineskybuscador ninesky
buscador ninesky
Valentin Estrada
 
Daykem
DaykemDaykem
Daykem
shell8bomb
 
MONICA JANE BUEZA RESUME
MONICA JANE BUEZA RESUMEMONICA JANE BUEZA RESUME
MONICA JANE BUEZA RESUME
Monica Jane Bueza
 
Formación padres "scanning the word"
Formación padres "scanning the word"Formación padres "scanning the word"
Formación padres "scanning the word"
ciausiasmarch
 
verify24x7 (Court Monitoring System)
verify24x7 (Court Monitoring System)verify24x7 (Court Monitoring System)
verify24x7 (Court Monitoring System)
Ansuya Sarma
 
JAVA SCRIPT
JAVA SCRIPTJAVA SCRIPT
JAVA SCRIPT
Go4Guru
 
Brand, Innovation & Design
Brand, Innovation & DesignBrand, Innovation & Design
Brand, Innovation & Design
Thomas Stack
 
The Rise & Importance of Fintech
The Rise & Importance of FintechThe Rise & Importance of Fintech
The Rise & Importance of Fintech
The Pathway Group
 
Pinned Sites IE 9 Lightup
Pinned Sites IE 9 LightupPinned Sites IE 9 Lightup
Pinned Sites IE 9 Lightup
Wes Yanaga
 
Windows Phone 7 Unleashed Session 2
Windows Phone 7 Unleashed Session 2Windows Phone 7 Unleashed Session 2
Windows Phone 7 Unleashed Session 2
Wes Yanaga
 
Windows Phone 7 Unleashed Session 1
Windows Phone 7 Unleashed Session 1Windows Phone 7 Unleashed Session 1
Windows Phone 7 Unleashed Session 1
Wes Yanaga
 
JungPumpen_Brochure-912010
JungPumpen_Brochure-912010JungPumpen_Brochure-912010
JungPumpen_Brochure-912010
Lisa Gabrish
 
Presentacion profesional
Presentacion profesionalPresentacion profesional
Presentacion profesional
Cruzcamalab
 
Ying's Portfolio 2016
Ying's Portfolio 2016Ying's Portfolio 2016
Ying's Portfolio 2016
Calvin Cheung
 
Formación padres "scanning the word"
Formación padres "scanning the word"Formación padres "scanning the word"
Formación padres "scanning the word"
ciausiasmarch
 
verify24x7 (Court Monitoring System)
verify24x7 (Court Monitoring System)verify24x7 (Court Monitoring System)
verify24x7 (Court Monitoring System)
Ansuya Sarma
 
JAVA SCRIPT
JAVA SCRIPTJAVA SCRIPT
JAVA SCRIPT
Go4Guru
 
Brand, Innovation & Design
Brand, Innovation & DesignBrand, Innovation & Design
Brand, Innovation & Design
Thomas Stack
 
The Rise & Importance of Fintech
The Rise & Importance of FintechThe Rise & Importance of Fintech
The Rise & Importance of Fintech
The Pathway Group
 
Ad

Similar to Introduction to java_script (20)

unit4 wp.pptxjvlbpuvghuigv8ytg2ugvugvuygv
unit4 wp.pptxjvlbpuvghuigv8ytg2ugvugvuygvunit4 wp.pptxjvlbpuvghuigv8ytg2ugvugvuygv
unit4 wp.pptxjvlbpuvghuigv8ytg2ugvugvuygv
utsavsd11
 
Journey To The Front End World - Part3 - The Machine
Journey To The Front End World - Part3 - The MachineJourney To The Front End World - Part3 - The Machine
Journey To The Front End World - Part3 - The Machine
Irfan Maulana
 
full javascript Book by Abhishek singh.pdf
full javascript  Book by Abhishek singh.pdffull javascript  Book by Abhishek singh.pdf
full javascript Book by Abhishek singh.pdf
AbhishekSingh961152
 
Learning About JavaScript (…and its little buddy, JQuery!)
Learning About JavaScript (…and its little buddy, JQuery!)Learning About JavaScript (…and its little buddy, JQuery!)
Learning About JavaScript (…and its little buddy, JQuery!)
Julie Meloni
 
javscript
javscriptjavscript
javscript
rcc1964
 
Javascript note for engineering notes.pptx
Javascript note for engineering notes.pptxJavascript note for engineering notes.pptx
Javascript note for engineering notes.pptx
engineeradda55
 
lecture 6 javascript event and event handling.ppt
lecture 6 javascript event and event handling.pptlecture 6 javascript event and event handling.ppt
lecture 6 javascript event and event handling.ppt
ULADATZ
 
Cordova training : Day 4 - Advanced Javascript
Cordova training : Day 4 - Advanced JavascriptCordova training : Day 4 - Advanced Javascript
Cordova training : Day 4 - Advanced Javascript
Binu Paul
 
22519 - Client-Side Scripting Language (CSS) chapter 1 notes .pdf
22519 - Client-Side Scripting Language (CSS) chapter 1 notes .pdf22519 - Client-Side Scripting Language (CSS) chapter 1 notes .pdf
22519 - Client-Side Scripting Language (CSS) chapter 1 notes .pdf
sharvaridhokte
 
Week3
Week3Week3
Week3
Will Gaybrick
 
Java script
Java scriptJava script
Java script
Yoga Raja
 
JavaScript Essentials in 1 Hour (2018)
JavaScript Essentials in 1 Hour (2018)JavaScript Essentials in 1 Hour (2018)
JavaScript Essentials in 1 Hour (2018)
Ahmed Ibrahim
 
Introduction to JavaScript, functions, DOM
Introduction to JavaScript, functions, DOMIntroduction to JavaScript, functions, DOM
Introduction to JavaScript, functions, DOM
LikhithaBrunda
 
Java script
 Java script Java script
Java script
bosybosy
 
CSC PPT 12.pptx
CSC PPT 12.pptxCSC PPT 12.pptx
CSC PPT 12.pptx
DrRavneetSingh
 
Unit5_Web_Updvvgxsvjbffcvvgbjifszated.pptx
Unit5_Web_Updvvgxsvjbffcvvgbjifszated.pptxUnit5_Web_Updvvgxsvjbffcvvgbjifszated.pptx
Unit5_Web_Updvvgxsvjbffcvvgbjifszated.pptx
1si23bt001
 
Coding 101: A hands-on introduction
Coding 101: A hands-on introduction Coding 101: A hands-on introduction
Coding 101: A hands-on introduction
Bohyun Kim
 
JavaScript_introduction_upload.pdf
JavaScript_introduction_upload.pdfJavaScript_introduction_upload.pdf
JavaScript_introduction_upload.pdf
Kongu Engineering College, Perundurai, Erode
 
HSC INFORMATION TECHNOLOGY CHAPTER 3 ADVANCED JAVASCRIPT
HSC INFORMATION TECHNOLOGY CHAPTER 3 ADVANCED JAVASCRIPTHSC INFORMATION TECHNOLOGY CHAPTER 3 ADVANCED JAVASCRIPT
HSC INFORMATION TECHNOLOGY CHAPTER 3 ADVANCED JAVASCRIPT
AAFREEN SHAIKH
 
Extjs
ExtjsExtjs
Extjs
Girish Srivastava
 
unit4 wp.pptxjvlbpuvghuigv8ytg2ugvugvuygv
unit4 wp.pptxjvlbpuvghuigv8ytg2ugvugvuygvunit4 wp.pptxjvlbpuvghuigv8ytg2ugvugvuygv
unit4 wp.pptxjvlbpuvghuigv8ytg2ugvugvuygv
utsavsd11
 
Journey To The Front End World - Part3 - The Machine
Journey To The Front End World - Part3 - The MachineJourney To The Front End World - Part3 - The Machine
Journey To The Front End World - Part3 - The Machine
Irfan Maulana
 
full javascript Book by Abhishek singh.pdf
full javascript  Book by Abhishek singh.pdffull javascript  Book by Abhishek singh.pdf
full javascript Book by Abhishek singh.pdf
AbhishekSingh961152
 
Learning About JavaScript (…and its little buddy, JQuery!)
Learning About JavaScript (…and its little buddy, JQuery!)Learning About JavaScript (…and its little buddy, JQuery!)
Learning About JavaScript (…and its little buddy, JQuery!)
Julie Meloni
 
javscript
javscriptjavscript
javscript
rcc1964
 
Javascript note for engineering notes.pptx
Javascript note for engineering notes.pptxJavascript note for engineering notes.pptx
Javascript note for engineering notes.pptx
engineeradda55
 
lecture 6 javascript event and event handling.ppt
lecture 6 javascript event and event handling.pptlecture 6 javascript event and event handling.ppt
lecture 6 javascript event and event handling.ppt
ULADATZ
 
Cordova training : Day 4 - Advanced Javascript
Cordova training : Day 4 - Advanced JavascriptCordova training : Day 4 - Advanced Javascript
Cordova training : Day 4 - Advanced Javascript
Binu Paul
 
22519 - Client-Side Scripting Language (CSS) chapter 1 notes .pdf
22519 - Client-Side Scripting Language (CSS) chapter 1 notes .pdf22519 - Client-Side Scripting Language (CSS) chapter 1 notes .pdf
22519 - Client-Side Scripting Language (CSS) chapter 1 notes .pdf
sharvaridhokte
 
JavaScript Essentials in 1 Hour (2018)
JavaScript Essentials in 1 Hour (2018)JavaScript Essentials in 1 Hour (2018)
JavaScript Essentials in 1 Hour (2018)
Ahmed Ibrahim
 
Introduction to JavaScript, functions, DOM
Introduction to JavaScript, functions, DOMIntroduction to JavaScript, functions, DOM
Introduction to JavaScript, functions, DOM
LikhithaBrunda
 
Java script
 Java script Java script
Java script
bosybosy
 
Unit5_Web_Updvvgxsvjbffcvvgbjifszated.pptx
Unit5_Web_Updvvgxsvjbffcvvgbjifszated.pptxUnit5_Web_Updvvgxsvjbffcvvgbjifszated.pptx
Unit5_Web_Updvvgxsvjbffcvvgbjifszated.pptx
1si23bt001
 
Coding 101: A hands-on introduction
Coding 101: A hands-on introduction Coding 101: A hands-on introduction
Coding 101: A hands-on introduction
Bohyun Kim
 
HSC INFORMATION TECHNOLOGY CHAPTER 3 ADVANCED JAVASCRIPT
HSC INFORMATION TECHNOLOGY CHAPTER 3 ADVANCED JAVASCRIPTHSC INFORMATION TECHNOLOGY CHAPTER 3 ADVANCED JAVASCRIPT
HSC INFORMATION TECHNOLOGY CHAPTER 3 ADVANCED JAVASCRIPT
AAFREEN SHAIKH
 
Ad

Recently uploaded (20)

IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
SweetytamannaMohapat
 
LDMMIA About me 2025 Edition 3 College Volume
LDMMIA About me 2025 Edition 3 College VolumeLDMMIA About me 2025 Edition 3 College Volume
LDMMIA About me 2025 Edition 3 College Volume
LDM & Mia eStudios
 
Order Lepidoptera: Butterflies and Moths.pptx
Order Lepidoptera: Butterflies and Moths.pptxOrder Lepidoptera: Butterflies and Moths.pptx
Order Lepidoptera: Butterflies and Moths.pptx
Arshad Shaikh
 
Active Surveillance For Localized Prostate Cancer A New Paradigm For Clinical...
Active Surveillance For Localized Prostate Cancer A New Paradigm For Clinical...Active Surveillance For Localized Prostate Cancer A New Paradigm For Clinical...
Active Surveillance For Localized Prostate Cancer A New Paradigm For Clinical...
wygalkelceqg
 
Introduction to Online CME for Nurse Practitioners.pdf
Introduction to Online CME for Nurse Practitioners.pdfIntroduction to Online CME for Nurse Practitioners.pdf
Introduction to Online CME for Nurse Practitioners.pdf
CME4Life
 
Diana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda - A Wauconda-Based EducatorDiana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda
 
প্রত্যুৎপন্নমতিত্ব - Prottutponnomotittwa 2025.pdf
প্রত্যুৎপন্নমতিত্ব - Prottutponnomotittwa 2025.pdfপ্রত্যুৎপন্নমতিত্ব - Prottutponnomotittwa 2025.pdf
প্রত্যুৎপন্নমতিত্ব - Prottutponnomotittwa 2025.pdf
Pragya - UEM Kolkata Quiz Club
 
Pragya Champion's Chalice 2025 Set , General Quiz
Pragya Champion's Chalice 2025 Set , General QuizPragya Champion's Chalice 2025 Set , General Quiz
Pragya Champion's Chalice 2025 Set , General Quiz
Pragya - UEM Kolkata Quiz Club
 
TechSoup Microsoft Copilot Nonprofit Use Cases and Live Demo - 2025.05.28.pdf
TechSoup Microsoft Copilot Nonprofit Use Cases and Live Demo - 2025.05.28.pdfTechSoup Microsoft Copilot Nonprofit Use Cases and Live Demo - 2025.05.28.pdf
TechSoup Microsoft Copilot Nonprofit Use Cases and Live Demo - 2025.05.28.pdf
TechSoup
 
Odoo 18 Point of Sale PWA - Odoo Slides
Odoo 18 Point of Sale PWA  - Odoo  SlidesOdoo 18 Point of Sale PWA  - Odoo  Slides
Odoo 18 Point of Sale PWA - Odoo Slides
Celine George
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 5-30-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 5-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-30-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
Coleoptera: The Largest Insect Order.pptx
Coleoptera: The Largest Insect Order.pptxColeoptera: The Largest Insect Order.pptx
Coleoptera: The Largest Insect Order.pptx
Arshad Shaikh
 
LDMMIA Bonus GUEST GRAD Student Check-in
LDMMIA Bonus GUEST GRAD Student Check-inLDMMIA Bonus GUEST GRAD Student Check-in
LDMMIA Bonus GUEST GRAD Student Check-in
LDM & Mia eStudios
 
Exploring Identity Through Colombian Companies
Exploring Identity Through Colombian CompaniesExploring Identity Through Colombian Companies
Exploring Identity Through Colombian Companies
OlgaLeonorTorresSnch
 
Search Engine Optimization (SEO) for Website Success
Search Engine Optimization (SEO) for Website SuccessSearch Engine Optimization (SEO) for Website Success
Search Engine Optimization (SEO) for Website Success
Muneeb Rana
 
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
 
LET´S PRACTICE GRAMMAR USING SIMPLE PAST TENSE
LET´S PRACTICE GRAMMAR USING SIMPLE PAST TENSELET´S PRACTICE GRAMMAR USING SIMPLE PAST TENSE
LET´S PRACTICE GRAMMAR USING SIMPLE PAST TENSE
OlgaLeonorTorresSnch
 
Forestry Model Exit Exam_2025_Wollega University, Gimbi Campus.pdf
Forestry Model Exit Exam_2025_Wollega University, Gimbi Campus.pdfForestry Model Exit Exam_2025_Wollega University, Gimbi Campus.pdf
Forestry Model Exit Exam_2025_Wollega University, Gimbi Campus.pdf
ChalaKelbessa
 
A Brief Introduction About Jack Lutkus
A Brief Introduction About  Jack  LutkusA Brief Introduction About  Jack  Lutkus
A Brief Introduction About Jack Lutkus
Jack Lutkus
 
QUIZ-O-FORCE FINAL SET BY SUDIPTA & SUBHAM.pptx
QUIZ-O-FORCE FINAL SET BY SUDIPTA & SUBHAM.pptxQUIZ-O-FORCE FINAL SET BY SUDIPTA & SUBHAM.pptx
QUIZ-O-FORCE FINAL SET BY SUDIPTA & SUBHAM.pptx
Sourav Kr Podder
 
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
IDSP(INTEGRATED DISEASE SURVEILLANCE PROGRAMME...
SweetytamannaMohapat
 
LDMMIA About me 2025 Edition 3 College Volume
LDMMIA About me 2025 Edition 3 College VolumeLDMMIA About me 2025 Edition 3 College Volume
LDMMIA About me 2025 Edition 3 College Volume
LDM & Mia eStudios
 
Order Lepidoptera: Butterflies and Moths.pptx
Order Lepidoptera: Butterflies and Moths.pptxOrder Lepidoptera: Butterflies and Moths.pptx
Order Lepidoptera: Butterflies and Moths.pptx
Arshad Shaikh
 
Active Surveillance For Localized Prostate Cancer A New Paradigm For Clinical...
Active Surveillance For Localized Prostate Cancer A New Paradigm For Clinical...Active Surveillance For Localized Prostate Cancer A New Paradigm For Clinical...
Active Surveillance For Localized Prostate Cancer A New Paradigm For Clinical...
wygalkelceqg
 
Introduction to Online CME for Nurse Practitioners.pdf
Introduction to Online CME for Nurse Practitioners.pdfIntroduction to Online CME for Nurse Practitioners.pdf
Introduction to Online CME for Nurse Practitioners.pdf
CME4Life
 
Diana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda - A Wauconda-Based EducatorDiana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda
 
প্রত্যুৎপন্নমতিত্ব - Prottutponnomotittwa 2025.pdf
প্রত্যুৎপন্নমতিত্ব - Prottutponnomotittwa 2025.pdfপ্রত্যুৎপন্নমতিত্ব - Prottutponnomotittwa 2025.pdf
প্রত্যুৎপন্নমতিত্ব - Prottutponnomotittwa 2025.pdf
Pragya - UEM Kolkata Quiz Club
 
TechSoup Microsoft Copilot Nonprofit Use Cases and Live Demo - 2025.05.28.pdf
TechSoup Microsoft Copilot Nonprofit Use Cases and Live Demo - 2025.05.28.pdfTechSoup Microsoft Copilot Nonprofit Use Cases and Live Demo - 2025.05.28.pdf
TechSoup Microsoft Copilot Nonprofit Use Cases and Live Demo - 2025.05.28.pdf
TechSoup
 
Odoo 18 Point of Sale PWA - Odoo Slides
Odoo 18 Point of Sale PWA  - Odoo  SlidesOdoo 18 Point of Sale PWA  - Odoo  Slides
Odoo 18 Point of Sale PWA - Odoo Slides
Celine George
 
Coleoptera: The Largest Insect Order.pptx
Coleoptera: The Largest Insect Order.pptxColeoptera: The Largest Insect Order.pptx
Coleoptera: The Largest Insect Order.pptx
Arshad Shaikh
 
LDMMIA Bonus GUEST GRAD Student Check-in
LDMMIA Bonus GUEST GRAD Student Check-inLDMMIA Bonus GUEST GRAD Student Check-in
LDMMIA Bonus GUEST GRAD Student Check-in
LDM & Mia eStudios
 
Exploring Identity Through Colombian Companies
Exploring Identity Through Colombian CompaniesExploring Identity Through Colombian Companies
Exploring Identity Through Colombian Companies
OlgaLeonorTorresSnch
 
Search Engine Optimization (SEO) for Website Success
Search Engine Optimization (SEO) for Website SuccessSearch Engine Optimization (SEO) for Website Success
Search Engine Optimization (SEO) for Website Success
Muneeb Rana
 
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
 
LET´S PRACTICE GRAMMAR USING SIMPLE PAST TENSE
LET´S PRACTICE GRAMMAR USING SIMPLE PAST TENSELET´S PRACTICE GRAMMAR USING SIMPLE PAST TENSE
LET´S PRACTICE GRAMMAR USING SIMPLE PAST TENSE
OlgaLeonorTorresSnch
 
Forestry Model Exit Exam_2025_Wollega University, Gimbi Campus.pdf
Forestry Model Exit Exam_2025_Wollega University, Gimbi Campus.pdfForestry Model Exit Exam_2025_Wollega University, Gimbi Campus.pdf
Forestry Model Exit Exam_2025_Wollega University, Gimbi Campus.pdf
ChalaKelbessa
 
A Brief Introduction About Jack Lutkus
A Brief Introduction About  Jack  LutkusA Brief Introduction About  Jack  Lutkus
A Brief Introduction About Jack Lutkus
Jack Lutkus
 
QUIZ-O-FORCE FINAL SET BY SUDIPTA & SUBHAM.pptx
QUIZ-O-FORCE FINAL SET BY SUDIPTA & SUBHAM.pptxQUIZ-O-FORCE FINAL SET BY SUDIPTA & SUBHAM.pptx
QUIZ-O-FORCE FINAL SET BY SUDIPTA & SUBHAM.pptx
Sourav Kr Podder
 

Introduction to java_script

  • 2. A little Background ➢ JavaScript isn’t JAVA ➢ Developed by Brendan Eich at Netscape ➢ Was called LiveScript ➢ Not a compiled language ➢ Case sensitive : function oneDrive() is different from function OneDrive() www.PracticalCoding.inwww.PracticalCoding.in
  • 3. What’s in a JavaScript Program? Statements formed from tokens, operators, and identifiers placed together in an order that is meaningful to a JavaScript interpreter, which is contained in most web browsers. www.PracticalCoding.inwww.PracticalCoding.in
  • 4. Where should I write it ? ➢ <head>...</head> ➢ <body>...</body> ➢ External file included in the HTML file <html> <head> <title>A Web Page Title</title> <script type="text/javascript"> // JavaScript Goes Here </script> <script type="text/javascript" src="myscript.js"> </head> <body> <script type="text/javascript"> // JavaScript can go here too </script> </body> </html> www.PracticalCoding.inwww.PracticalCoding.in
  • 5. Comments ➢/* This is a multiline comment */ ➢// This is a single line comment www.PracticalCoding.inwww.PracticalCoding.in
  • 7. Data types ➢Numbers ➢Strings ➢Booleans ➢Null (Empty is not Null) ➢undefined ➢Objects www.PracticalCoding.inwww.PracticalCoding.in
  • 9. Strings Open firebug, type a string and explore the methods available www.PracticalCoding.inwww.PracticalCoding.in
  • 10. Date object Open firebug and explore www.PracticalCoding.inwww.PracticalCoding.in
  • 11. For loops for (var i = 0; i < 1000; i++) { //do something ) www.PracticalCoding.inwww.PracticalCoding.in
  • 12. Operators ➢ Additive operators ( +/- ) ➢ Multiplicative operators ( *, /) ➢ Bitwise operators (&,|,^,!,<<,>>,>>>) ➢ Equality operators (==,!=,===,!==) ➢ Relational operators (<,>,>=,<=,in, instanceof) ➢ Unary operators(delete,void,typeof,++,--,+,-,!,~) ➢ Assignment operators www.PracticalCoding.inwww.PracticalCoding.in
  • 13. Controlling flow with conditionals and loops ➢ if else conditional statement and ternary operations ➢ switch statement ➢ while loop and a do...while loop ➢ for loops (general, for..each and for..in) www.PracticalCoding.inwww.PracticalCoding.in
  • 14. Functions <script type="text/javascript"> function myFunction() { var firstArg = arguments[0]; var secondArg = arguments[1]; alert("firstArg is: " + firstArg); alert("secondArg is: " + secondArg); } myFunction("hello","world"); </script> www.PracticalCoding.inwww.PracticalCoding.in
  • 15. Function literal JavaScript does not require functions to be defined formally. www.PracticalCoding.inwww.PracticalCoding.in
  • 16. Objects Properties Methods and whats this ? www.PracticalCoding.inwww.PracticalCoding.in
  • 17. Arrays ➢ Creation ➢ Methods ➢ Copying arrays ➢ push() and pop() ➢ Iterating through arrays using for() Explore arrays in Firebug ! www.PracticalCoding.inwww.PracticalCoding.in
  • 18. Timers ➢ setInterval() ➢ clearInterval() ➢ setTimeout() ➢ clearTimeout() www.PracticalCoding.inwww.PracticalCoding.in
  • 19. Window object ➢ document ➢ frames ➢ history ➢ location ➢ navigator ➢ screen ➢ self/window/parent www.PracticalCoding.inwww.PracticalCoding.in
  • 20. Observing the built in properties and methods var body = document.getElementsByTagName("body")[0]; for (var prop in navigator) { var elem = document.createElement("p"); var text = document.createTextNode(prop + ": " + navigator[prop]); elem.appendChild(text); body.appendChild(elem); } Replace the ‘navigator’ with other objects to check. www.PracticalCoding.inwww.PracticalCoding.in
  • 21. Tree structure of DOM www.PracticalCoding.inwww.PracticalCoding.in
  • 23. HTML Collections ➢document.anchors (requires ‘name’) ➢document.forms ➢document.images ➢document.links(requires ‘href’) www.PracticalCoding.inwww.PracticalCoding.in
  • 24. Siblings and Children ➢ .childNodes[0] ➢ nextSibling ➢ previousSibling ➢ firstChild ➢ lastChild www.PracticalCoding.inwww.PracticalCoding.in
  • 25. Events onblur() The element lost focus (that is, it is not selected by the user). onchange() The element has either changed (for example, a user typed into a text field) or lost focus. onclick() The mouse clicked an element. ondblclick() The mouse double-clicked an element. onfocus() The element got focus. onkeydown() A keyboard key is pressed (as opposed to released) while the element has focus. onkeypress() A keyboard key is pressed while the element has focus. onkeyup() A keyboard key is released while the element has focus. onload() The element is loaded (a document, a frameset, or an image). onmousedown() A mouse button is pressed. onmousemove() The mouse is moved. onmouseout() The mouse is moved off of or away from an element. onmouseover() The mouse is over an element. onmouseup() A mouse button is released. onreset() The form element is reset, such as when a user presses a form reset button. onresize() The window’s size is changed. onselect() The text of a form element is selected. onsubmit() The form is submitted. onunload() The document or frameset is unloaded. www.PracticalCoding.inwww.PracticalCoding.in