SlideShare a Scribd company logo
JavaScript / Web Engineering / Web Development / html + css + js/presentation
Topic
JavaScript
Group Member:
• Hamza Khan
• Mohammad Sajid
• Abdul Wahab
What can we do with Java Script
•Make webpage interactive
•Slider
•Image Galleries
•Form Validation
•Game Development
Java Script tag
• <script type=“text/Java script”></script>
How To Generate Message
Alert(“Hello world”);
Document.write Function in javascript
written on web page
• Document.write();
Show on web page
Document.write(“Hello world”);
Document.write Function in javascript
• Heading on webpage by javaScript
Document.write(“<h1>Hello</h1>”)
Types in java Script
1-String
2-Number
3-Boolean
4-Array
5-Object
Variable in java Script
• Variable are used to hold or store data
How to take data type in java script
Var name=“Ali Bhai”;
Alert(name);
Alert(typeof name);
Variable in java Script(cont)
Var num=25;
Alert(num);
Alert(typeof num);
Var Hk=“null”;
Alert(Hk);
(typeof object);
If-else Statement in javaScript
Syntax:
If(Condition){
//execute if block
}
Else{
//execute else block
}
If-else Statement in javaScript(con)
Var a=10;
Var b=11;
If(a==b)
{
Alert(“values are equal”);
}
Else
{
Alert(“Values are not equal”);
}
Functions in javascript
• Function eliminates the need of writing the
same code again and again.
Function welcome(){
Alert(“welcome to College”);
}
Welcome();
Welcome();
Airthmetic operations in JavaScript
• Addition +
• Subtraction –
• Multiplication *
• Division /
• (Division Reminder)%
• Increment ++
• Decrement --
Addition program in javaScript
Var add = 10 + 15;
document.write(add);
Here,
Operand=10 and 15
Operator= + sign
Subtraction program in javaScript
Var sub = 10 - 5;
document.write(sub);
Here,
Operand=10 and 15
Operator= - sign
Multiplication program in
javaScript
Var mul = 5 * 5;
document.write(mul);
Here,
Operand=5 and 5
Operator= * sign
Division program in javaScript
Var div = 5/5;
document.write(div);
Here,
Operand=5 and 5
Operator= / sign
Remainder program in javaScript
Var rem = 5%5;
document.write(rem);
Here,
Operand=5 and 5
Operator= % sign
Operator order of Precedence in javaScript
Var rem = 5+5*10;
document.write(rem);
First precedence Multiplication and
Division
Answer=55
Operator order of Precedence in
javaScript(Cont)
Var rem = (5+5)*10;
document.write(rem);
First Highest precedence is bracket
then Multiplication and Division
Answer=100
Increment and decrement operator in
javascript
Var Ans=10;
Ans++;
document.write(Ans);
Var Ans=11;
Ans--;
document.write(Ans);
Comparison operator in javascript
• ==(equal to)
• ===(equal value and type)
• !=(not equal)
• > greater than
• < Less than
• >= (greater than or equal to)
• < =(Less than or equal to)
Comparison operator in javascript(cont)
Var a=10, b=10
If(a==b){
document.write(“both values are
same”);
}
Ans=both values are same
Comparison operator in javascript(cont)
Var a=10, b=“10”
If(a===b){
document.write(“both values are same”);
}
Else{
document.write(“both values not are
same”);
}
Ans=not same
// because triple equal check values and
data type also
Comparison operator in javascript(cont)
Var a=10, b=5
If(a!=b){
document.write(“both values are not equal”);
}
Comparison operator in javascript(cont)
Var a=10, b=5
If(a>b){
document.write(“a greater than b”);
}
Comparison operator in javascript(cont)
Var a=10, b=5
If(a<b){
document.write(“a Less than b”);
}
Comparison operator in javascript(cont)
Var age=18
If(age >=18)
{
document.write(“you are eligible”);
}
Else{
Alert(“not Eligible”);
}
Ans=eligible
Math funcitons in javaScript
• Math.round();
• Math.sqrt();
• Math.power();
• Math.min();
• Math.max();
• Math.random();
• Math.floor(math.random() * 1000);
Loop in JavaScript
• For Loop
• While Loop
• Do while Loop
For loop in JavaScript
Syntax;
for(initialization; condition; increment/decriment )
E.g:
For(var i=1; i<6; i++)
{ document.write( “hello” + I + “ <br/ >” )
}
While Loop in javaScript
E.g:
var i=1;
While( i < 6 )
{ document.write( “hello”+ I + “ <br/ >” )
i++;
}
Do While loop in javaScript
E.g:
Var i=1;
do
{ document.write{“hello”+i+”<br>”}
i++;
}
While(i<6);
Array
Arrays
Data structures of related items
Each element has a position number
Dynamic
Size of an array in JavaScript can be changed
(increased) AFTER it is created
Arrays in JavaScript
• Each element referenced by a number
Start at “zeroth element”: 10 element array
has elements: 0,1,2 ,..,8,9
Subscript or index
• Accessing a specific element
Name of array
Brackets
Number of element
• Arrays know their length
length property
c[ 6 ]
-45
6
0
72
1543
-89
0
62
-3
1
6453
78
Name of array c[ 0 ]
c[ 1 ]
c[ 2 ]
c[ 3 ]
c[ 11 ]
c[ 10 ]
c[ 9 ]
c[ 8 ]
c[ 7 ]
c[ 5 ]
c[ 4 ]
Position number (index
or subscript) of the
element within array c
Fig. 11.1 A 12-element array.
Declaring and Allocating Arrays
• Arrays in memory
– Objects
– Operator new
• Allocates memory for objects
• Dynamic memory allocation operator
var c;  array declaration
c = new Array( 12 );  memory allocation
Using Arrays
• Arrays can grow dynamically
– Allocate more space as more items are added
than originally planned for
• Array elements must be initialized explicitly
– Default value is “undefined”
– for loops convenient fro initialization
– Referring to uninitialized elements or elements
outside array bounds is an error
Examples Using Arrays
• for…in statement
– Perform an action for each element in an array
– Iterates over array elements
• Assigns each element to specified variable one at a
time
– Ignores non-existent elements
Multidimensional Arrays
• Two-dimensional arrays analogous to tables
– Rows and columns
• Specify row first, then column
– Two subscripts
Multidimensional Arrays
a[ 1 ][ 0 ] a[ 1 ][ 1 ] a[ 1 ][ 2 ] a[ 1 ][ 3 ]
Row 0
Row 1
Row 2
Column 0 Column 1 Column 2 Column 3
Row subscript (or index)
Array name
Column subscript (or index)
a[ 0 ][ 0 ] a[ 0 ][ 1 ] a[ 0 ][ 2 ] a[ 0 ][ 3 ]
a[ 2 ][ 0 ] a[ 2 ][ 1 ] a[ 2 ][ 2 ] a[ 2 ][ 3 ]
Two-dimensional array with three rows and four columns.
JavaScript / Web Engineering / Web Development / html + css + js/presentation

More Related Content

What's hot (20)

PPTX
Queues
Ashim Lamichhane
 
PPSX
JDBC: java DataBase connectivity
Tanmoy Barman
 
PDF
Object-oriented Programming-with C#
Doncho Minkov
 
PDF
Servlet and servlet life cycle
Dhruvin Nakrani
 
PPTX
ReactJS presentation.pptx
DivyanshGupta922023
 
PPTX
Files in php
sana mateen
 
PPTX
JSON: The Basics
Jeff Fox
 
PPTX
Basics of JAVA programming
Elizabeth Thomas
 
PPT
Stack Operation In Data Structure
DivyeshKumar Jagatiya
 
PPTX
Jdbc_ravi_2016
Ravinder Singh Karki
 
PPT
Spring Framework
nomykk
 
PPT
11. transaction sql
Umang Gupta
 
PPTX
Presentation on "An Introduction to ReactJS"
Flipkart
 
PPTX
Sorting Algorithms
Pranay Neema
 
PDF
Java threads
Prabhakaran V M
 
PPT
Unit 4 external sorting
DrkhanchanaR
 
JDBC: java DataBase connectivity
Tanmoy Barman
 
Object-oriented Programming-with C#
Doncho Minkov
 
Servlet and servlet life cycle
Dhruvin Nakrani
 
ReactJS presentation.pptx
DivyanshGupta922023
 
Files in php
sana mateen
 
JSON: The Basics
Jeff Fox
 
Basics of JAVA programming
Elizabeth Thomas
 
Stack Operation In Data Structure
DivyeshKumar Jagatiya
 
Jdbc_ravi_2016
Ravinder Singh Karki
 
Spring Framework
nomykk
 
11. transaction sql
Umang Gupta
 
Presentation on "An Introduction to ReactJS"
Flipkart
 
Sorting Algorithms
Pranay Neema
 
Java threads
Prabhakaran V M
 
Unit 4 external sorting
DrkhanchanaR
 

Similar to JavaScript / Web Engineering / Web Development / html + css + js/presentation (20)

PPTX
Java script advance-auroskills (2)
BoneyGawande
 
PPT
jQuery Objects
Steve Wells
 
PPT
Presentation JavaScript Introduction Data Types Variables Control Structure
SripathiRavi1
 
PPTX
Java script basics
Shrivardhan Limbkar
 
PPTX
Java script.pptx v
22x026
 
PDF
Java Script
Sarvan15
 
PPT
Java Script
Sarvan15
 
PPT
JavaScript ppt for introduction of javascripta
nehatanveer5765
 
PDF
Javascript
20261A05H0SRIKAKULAS
 
PDF
JavaScript Interview Questions Part - 1.pdf
katarichallenge
 
PDF
HSC INFORMATION TECHNOLOGY CHAPTER 3 ADVANCED JAVASCRIPT
AAFREEN SHAIKH
 
PPT
Java Script ppt
Priya Goyal
 
PPTX
JavaScript_III.pptx
rashmiisrani1
 
PPSX
Javascript variables and datatypes
Varun C M
 
PPTX
JavaScript Basics - GameCraft Training
Radoslav Georgiev
 
PDF
JavaScript(Es5) Interview Questions & Answers
Ratnala Charan kumar
 
PDF
Client sidescripting javascript
Selvin Josy Bai Somu
 
PPT
Ajax and JavaScript Bootcamp
AndreCharland
 
PPTX
Javascript
Prashant Kumar
 
PPTX
Java script
Abhishek Kesharwani
 
Java script advance-auroskills (2)
BoneyGawande
 
jQuery Objects
Steve Wells
 
Presentation JavaScript Introduction Data Types Variables Control Structure
SripathiRavi1
 
Java script basics
Shrivardhan Limbkar
 
Java script.pptx v
22x026
 
Java Script
Sarvan15
 
Java Script
Sarvan15
 
JavaScript ppt for introduction of javascripta
nehatanveer5765
 
JavaScript Interview Questions Part - 1.pdf
katarichallenge
 
HSC INFORMATION TECHNOLOGY CHAPTER 3 ADVANCED JAVASCRIPT
AAFREEN SHAIKH
 
Java Script ppt
Priya Goyal
 
JavaScript_III.pptx
rashmiisrani1
 
Javascript variables and datatypes
Varun C M
 
JavaScript Basics - GameCraft Training
Radoslav Georgiev
 
JavaScript(Es5) Interview Questions & Answers
Ratnala Charan kumar
 
Client sidescripting javascript
Selvin Josy Bai Somu
 
Ajax and JavaScript Bootcamp
AndreCharland
 
Javascript
Prashant Kumar
 
Java script
Abhishek Kesharwani
 
Ad

More from M Sajid R (6)

PPTX
Binary Search Tree (BST)
M Sajid R
 
PPTX
Transport layer
M Sajid R
 
PPTX
Novartis
M Sajid R
 
PPTX
Query o
M Sajid R
 
PPTX
Network And Topology
M Sajid R
 
PPTX
Toyota
M Sajid R
 
Binary Search Tree (BST)
M Sajid R
 
Transport layer
M Sajid R
 
Novartis
M Sajid R
 
Query o
M Sajid R
 
Network And Topology
M Sajid R
 
Toyota
M Sajid R
 
Ad

Recently uploaded (20)

PPTX
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
PDF
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
PPTX
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
PDF
People & Earth's Ecosystem -Lesson 2: People & Population
marvinnbustamante1
 
PPTX
Quarter1-English3-W4-Identifying Elements of the Story
FLORRACHELSANTOS
 
PDF
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
PDF
The Different Types of Non-Experimental Research
Thelma Villaflores
 
PPTX
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
PPTX
How to Set Maximum Difference Odoo 18 POS
Celine George
 
PPTX
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
PDF
Dimensions of Societal Planning in Commonism
StefanMz
 
PDF
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
PPTX
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
PPTX
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
PDF
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
PDF
SSHS-2025-PKLP_Quarter-1-Dr.-Kerby-Alvarez.pdf
AishahSangcopan1
 
PPTX
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
PPTX
THE TAME BIRD AND THE FREE BIRD.pptxxxxx
MarcChristianNicolas
 
PPSX
Health Planning in india - Unit 03 - CHN 2 - GNM 3RD YEAR.ppsx
Priyanshu Anand
 
PPSX
HEALTH ASSESSMENT (Community Health Nursing) - GNM 1st Year
Priyanshu Anand
 
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
People & Earth's Ecosystem -Lesson 2: People & Population
marvinnbustamante1
 
Quarter1-English3-W4-Identifying Elements of the Story
FLORRACHELSANTOS
 
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
The Different Types of Non-Experimental Research
Thelma Villaflores
 
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
How to Set Maximum Difference Odoo 18 POS
Celine George
 
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
Dimensions of Societal Planning in Commonism
StefanMz
 
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
SSHS-2025-PKLP_Quarter-1-Dr.-Kerby-Alvarez.pdf
AishahSangcopan1
 
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
THE TAME BIRD AND THE FREE BIRD.pptxxxxx
MarcChristianNicolas
 
Health Planning in india - Unit 03 - CHN 2 - GNM 3RD YEAR.ppsx
Priyanshu Anand
 
HEALTH ASSESSMENT (Community Health Nursing) - GNM 1st Year
Priyanshu Anand
 

JavaScript / Web Engineering / Web Development / html + css + js/presentation

  • 2. Topic JavaScript Group Member: • Hamza Khan • Mohammad Sajid • Abdul Wahab
  • 3. What can we do with Java Script •Make webpage interactive •Slider •Image Galleries •Form Validation •Game Development
  • 4. Java Script tag • <script type=“text/Java script”></script>
  • 5. How To Generate Message Alert(“Hello world”);
  • 6. Document.write Function in javascript written on web page • Document.write(); Show on web page Document.write(“Hello world”);
  • 7. Document.write Function in javascript • Heading on webpage by javaScript Document.write(“<h1>Hello</h1>”)
  • 8. Types in java Script 1-String 2-Number 3-Boolean 4-Array 5-Object
  • 9. Variable in java Script • Variable are used to hold or store data How to take data type in java script Var name=“Ali Bhai”; Alert(name); Alert(typeof name);
  • 10. Variable in java Script(cont) Var num=25; Alert(num); Alert(typeof num); Var Hk=“null”; Alert(Hk); (typeof object);
  • 11. If-else Statement in javaScript Syntax: If(Condition){ //execute if block } Else{ //execute else block }
  • 12. If-else Statement in javaScript(con) Var a=10; Var b=11; If(a==b) { Alert(“values are equal”); } Else { Alert(“Values are not equal”); }
  • 13. Functions in javascript • Function eliminates the need of writing the same code again and again. Function welcome(){ Alert(“welcome to College”); } Welcome(); Welcome();
  • 14. Airthmetic operations in JavaScript • Addition + • Subtraction – • Multiplication * • Division / • (Division Reminder)% • Increment ++ • Decrement --
  • 15. Addition program in javaScript Var add = 10 + 15; document.write(add); Here, Operand=10 and 15 Operator= + sign
  • 16. Subtraction program in javaScript Var sub = 10 - 5; document.write(sub); Here, Operand=10 and 15 Operator= - sign
  • 17. Multiplication program in javaScript Var mul = 5 * 5; document.write(mul); Here, Operand=5 and 5 Operator= * sign
  • 18. Division program in javaScript Var div = 5/5; document.write(div); Here, Operand=5 and 5 Operator= / sign
  • 19. Remainder program in javaScript Var rem = 5%5; document.write(rem); Here, Operand=5 and 5 Operator= % sign
  • 20. Operator order of Precedence in javaScript Var rem = 5+5*10; document.write(rem); First precedence Multiplication and Division Answer=55
  • 21. Operator order of Precedence in javaScript(Cont) Var rem = (5+5)*10; document.write(rem); First Highest precedence is bracket then Multiplication and Division Answer=100
  • 22. Increment and decrement operator in javascript Var Ans=10; Ans++; document.write(Ans); Var Ans=11; Ans--; document.write(Ans);
  • 23. Comparison operator in javascript • ==(equal to) • ===(equal value and type) • !=(not equal) • > greater than • < Less than • >= (greater than or equal to) • < =(Less than or equal to)
  • 24. Comparison operator in javascript(cont) Var a=10, b=10 If(a==b){ document.write(“both values are same”); } Ans=both values are same
  • 25. Comparison operator in javascript(cont) Var a=10, b=“10” If(a===b){ document.write(“both values are same”); } Else{ document.write(“both values not are same”); } Ans=not same // because triple equal check values and data type also
  • 26. Comparison operator in javascript(cont) Var a=10, b=5 If(a!=b){ document.write(“both values are not equal”); }
  • 27. Comparison operator in javascript(cont) Var a=10, b=5 If(a>b){ document.write(“a greater than b”); }
  • 28. Comparison operator in javascript(cont) Var a=10, b=5 If(a<b){ document.write(“a Less than b”); }
  • 29. Comparison operator in javascript(cont) Var age=18 If(age >=18) { document.write(“you are eligible”); } Else{ Alert(“not Eligible”); } Ans=eligible
  • 30. Math funcitons in javaScript • Math.round(); • Math.sqrt(); • Math.power(); • Math.min(); • Math.max(); • Math.random(); • Math.floor(math.random() * 1000);
  • 31. Loop in JavaScript • For Loop • While Loop • Do while Loop
  • 32. For loop in JavaScript Syntax; for(initialization; condition; increment/decriment ) E.g: For(var i=1; i<6; i++) { document.write( “hello” + I + “ <br/ >” ) }
  • 33. While Loop in javaScript E.g: var i=1; While( i < 6 ) { document.write( “hello”+ I + “ <br/ >” ) i++; }
  • 34. Do While loop in javaScript E.g: Var i=1; do { document.write{“hello”+i+”<br>”} i++; } While(i<6);
  • 35. Array Arrays Data structures of related items Each element has a position number Dynamic Size of an array in JavaScript can be changed (increased) AFTER it is created
  • 36. Arrays in JavaScript • Each element referenced by a number Start at “zeroth element”: 10 element array has elements: 0,1,2 ,..,8,9 Subscript or index • Accessing a specific element Name of array Brackets Number of element • Arrays know their length length property
  • 37. c[ 6 ] -45 6 0 72 1543 -89 0 62 -3 1 6453 78 Name of array c[ 0 ] c[ 1 ] c[ 2 ] c[ 3 ] c[ 11 ] c[ 10 ] c[ 9 ] c[ 8 ] c[ 7 ] c[ 5 ] c[ 4 ] Position number (index or subscript) of the element within array c Fig. 11.1 A 12-element array.
  • 38. Declaring and Allocating Arrays • Arrays in memory – Objects – Operator new • Allocates memory for objects • Dynamic memory allocation operator var c;  array declaration c = new Array( 12 );  memory allocation
  • 39. Using Arrays • Arrays can grow dynamically – Allocate more space as more items are added than originally planned for • Array elements must be initialized explicitly – Default value is “undefined” – for loops convenient fro initialization – Referring to uninitialized elements or elements outside array bounds is an error
  • 40. Examples Using Arrays • for…in statement – Perform an action for each element in an array – Iterates over array elements • Assigns each element to specified variable one at a time – Ignores non-existent elements
  • 41. Multidimensional Arrays • Two-dimensional arrays analogous to tables – Rows and columns • Specify row first, then column – Two subscripts
  • 42. Multidimensional Arrays a[ 1 ][ 0 ] a[ 1 ][ 1 ] a[ 1 ][ 2 ] a[ 1 ][ 3 ] Row 0 Row 1 Row 2 Column 0 Column 1 Column 2 Column 3 Row subscript (or index) Array name Column subscript (or index) a[ 0 ][ 0 ] a[ 0 ][ 1 ] a[ 0 ][ 2 ] a[ 0 ][ 3 ] a[ 2 ][ 0 ] a[ 2 ][ 1 ] a[ 2 ][ 2 ] a[ 2 ][ 3 ] Two-dimensional array with three rows and four columns.