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

PPTX
AVL Tree in Data Structure
PDF
SQL Joins With Examples | Edureka
PPTX
Integrity Constraints
PPTX
Normal forms
PPTX
Critical section problem in operating system.
PPTX
Database System Architectures
PPTX
Jsp lifecycle
PDF
Servlet and servlet life cycle
AVL Tree in Data Structure
SQL Joins With Examples | Edureka
Integrity Constraints
Normal forms
Critical section problem in operating system.
Database System Architectures
Jsp lifecycle
Servlet and servlet life cycle

What's hot (20)

PPSX
Data Structure (Stack)
PPTX
Types of keys dbms
PPSX
Collections - Lists, Sets
PPTX
Log based and Recovery with concurrent transaction
PPTX
SQL Joins.pptx
PPT
Java Servlets
PPTX
Transaction Properties in database | ACID Properties
PPTX
directory structure and file system mounting
PPTX
Sql Constraints
PPTX
AGGREGATE FUNCTION.pptx
PPT
OPERATING SYSTEM SERVICES, OPERATING SYSTEM STRUCTURES
ODP
Object Oriented Javascript
PPTX
deque and it applications
PPTX
PPTX
Client server architecture
DOC
DBMS Practical File
PPTX
Breadth First Search & Depth First Search
PPTX
Protocols and the TCP/IP Protocol Suite
PPT
Monoalphabetic Substitution Cipher
PPSX
Data Structure (Stack)
Types of keys dbms
Collections - Lists, Sets
Log based and Recovery with concurrent transaction
SQL Joins.pptx
Java Servlets
Transaction Properties in database | ACID Properties
directory structure and file system mounting
Sql Constraints
AGGREGATE FUNCTION.pptx
OPERATING SYSTEM SERVICES, OPERATING SYSTEM STRUCTURES
Object Oriented Javascript
deque and it applications
Client server architecture
DBMS Practical File
Breadth First Search & Depth First Search
Protocols and the TCP/IP Protocol Suite
Monoalphabetic Substitution Cipher
Ad

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

PPTX
Javascript 101
PPTX
Introduction to Client-Side Javascript
PPTX
CSC PPT 13.pptx
PPTX
Java Script Basic to Advanced For Beginner to Advanced Learner.pptx
PDF
Client sidescripting javascript
PPT
Javascript
DOC
Java script questions
PPT
Introduction to javascript.ppt
PDF
Fewd week5 slides
PPSX
Javascript variables and datatypes
PPTX
Unit - 4 all script are here Javascript.pptx
PPTX
Web designing unit 4
PPTX
03. Week 03.pptx
PDF
Javascript - Tutorial
PPT
An introduction to javascript
PDF
javascript-variablesanddatatypes-130218094831-phpapp01.pdf
PPTX
1-JAVA SCRIPT. servere-side applications vs client side applications
PPTX
JavaScript Proven Practises
PDF
GeoGebra JavaScript CheatSheet
PPTX
An introduction to javascript
Javascript 101
Introduction to Client-Side Javascript
CSC PPT 13.pptx
Java Script Basic to Advanced For Beginner to Advanced Learner.pptx
Client sidescripting javascript
Javascript
Java script questions
Introduction to javascript.ppt
Fewd week5 slides
Javascript variables and datatypes
Unit - 4 all script are here Javascript.pptx
Web designing unit 4
03. Week 03.pptx
Javascript - Tutorial
An introduction to javascript
javascript-variablesanddatatypes-130218094831-phpapp01.pdf
1-JAVA SCRIPT. servere-side applications vs client side applications
JavaScript Proven Practises
GeoGebra JavaScript CheatSheet
An introduction to javascript
Ad

More from M Sajid R (6)

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

Recently uploaded (20)

PPTX
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
PDF
Cell Biology Basics: Cell Theory, Structure, Types, and Organelles | BS Level...
DOCX
UPPER GASTRO INTESTINAL DISORDER.docx
PPTX
Week 4 Term 3 Study Techniques revisited.pptx
PDF
The Final Stretch: How to Release a Game and Not Die in the Process.
PDF
5.Universal-Franchise-and-Indias-Electoral-System.pdfppt/pdf/8th class social...
PPTX
Strengthening open access through collaboration: building connections with OP...
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
LDMMIA Reiki Yoga S2 L3 Vod Sample Preview
PDF
Piense y hagase Rico - Napoleon Hill Ccesa007.pdf
PDF
High Ground Student Revision Booklet Preview
PDF
Electrolyte Disturbances and Fluid Management A clinical and physiological ap...
PPTX
Revamp in MTO Odoo 18 Inventory - Odoo Slides
PPTX
Congenital Hypothyroidism pptx
PDF
Module 3: Health Systems Tutorial Slides S2 2025
PPTX
Open Quiz Monsoon Mind Game Prelims.pptx
PDF
Mga Unang Hakbang Tungo Sa Tao by Joe Vibar Nero.pdf
PPTX
IMMUNIZATION PROGRAMME pptx
PPTX
ACUTE NASOPHARYNGITIS. pptx
PPTX
Software Engineering BSC DS UNIT 1 .pptx
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
Cell Biology Basics: Cell Theory, Structure, Types, and Organelles | BS Level...
UPPER GASTRO INTESTINAL DISORDER.docx
Week 4 Term 3 Study Techniques revisited.pptx
The Final Stretch: How to Release a Game and Not Die in the Process.
5.Universal-Franchise-and-Indias-Electoral-System.pdfppt/pdf/8th class social...
Strengthening open access through collaboration: building connections with OP...
102 student loan defaulters named and shamed – Is someone you know on the list?
LDMMIA Reiki Yoga S2 L3 Vod Sample Preview
Piense y hagase Rico - Napoleon Hill Ccesa007.pdf
High Ground Student Revision Booklet Preview
Electrolyte Disturbances and Fluid Management A clinical and physiological ap...
Revamp in MTO Odoo 18 Inventory - Odoo Slides
Congenital Hypothyroidism pptx
Module 3: Health Systems Tutorial Slides S2 2025
Open Quiz Monsoon Mind Game Prelims.pptx
Mga Unang Hakbang Tungo Sa Tao by Joe Vibar Nero.pdf
IMMUNIZATION PROGRAMME pptx
ACUTE NASOPHARYNGITIS. pptx
Software Engineering BSC DS UNIT 1 .pptx

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.