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

PDF
Introduction to XHTML
PPTX
PPTX
Html5
PPT
JQuery introduction
PPT
Servlet life cycle
PPT
introduction to web technology
PPT
Introduction to CSS
Introduction to XHTML
Html5
JQuery introduction
Servlet life cycle
introduction to web technology
Introduction to CSS

What's hot (20)

PPT
SQL Tutorial - Basic Commands
PPT
Eye catching HTML BASICS tips: Learn easily
PPTX
Bootstrap PPT by Mukesh
PDF
Functions in C++
PPTX
What is css
PDF
Html 5 New Features
PDF
GET and POST in PHP
PPTX
PPTX
Css Complete Notes
PPT
PHP POWERPOINT SLIDES
PPT
3 Tier Architecture
PPTX
Sessions in php
PPTX
Javascript
PPT
Html Ppt
PPTX
Flex box
PPTX
Css types internal, external and inline (1)
PPT
Php Presentation
PPTX
Html5 tutorial for beginners
PPTX
Introduction to web application development
SQL Tutorial - Basic Commands
Eye catching HTML BASICS tips: Learn easily
Bootstrap PPT by Mukesh
Functions in C++
What is css
Html 5 New Features
GET and POST in PHP
Css Complete Notes
PHP POWERPOINT SLIDES
3 Tier Architecture
Sessions in php
Javascript
Html Ppt
Flex box
Css types internal, external and inline (1)
Php Presentation
Html5 tutorial for beginners
Introduction to web application development
Ad

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

PPTX
Java script advance-auroskills (2)
PPT
jQuery Objects
PPT
Presentation JavaScript Introduction Data Types Variables Control Structure
PPTX
Java script basics
PPTX
Java script.pptx v
PDF
Java Script
PPT
Java Script
PPT
JavaScript ppt for introduction of javascripta
PDF
PDF
JavaScript Interview Questions Part - 1.pdf
PDF
HSC INFORMATION TECHNOLOGY CHAPTER 3 ADVANCED JAVASCRIPT
PPT
Java Script ppt
PPTX
JavaScript_III.pptx
PPSX
Javascript variables and datatypes
PPTX
JavaScript Basics - GameCraft Training
PDF
JavaScript(Es5) Interview Questions & Answers
PDF
Client sidescripting javascript
PPT
Ajax and JavaScript Bootcamp
PPTX
Javascript
PPTX
Java script
Java script advance-auroskills (2)
jQuery Objects
Presentation JavaScript Introduction Data Types Variables Control Structure
Java script basics
Java script.pptx v
Java Script
Java Script
JavaScript ppt for introduction of javascripta
JavaScript Interview Questions Part - 1.pdf
HSC INFORMATION TECHNOLOGY CHAPTER 3 ADVANCED JAVASCRIPT
Java Script ppt
JavaScript_III.pptx
Javascript variables and datatypes
JavaScript Basics - GameCraft Training
JavaScript(Es5) Interview Questions & Answers
Client sidescripting javascript
Ajax and JavaScript Bootcamp
Javascript
Java script
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)

DOCX
Cambridge-Practice-Tests-for-IELTS-12.docx
PDF
David L Page_DCI Research Study Journey_how Methodology can inform one's prac...
PPTX
Unit 4 Computer Architecture Multicore Processor.pptx
PDF
Hazard Identification & Risk Assessment .pdf
PDF
HVAC Specification 2024 according to central public works department
PDF
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
PPTX
Computer Architecture Input Output Memory.pptx
PPTX
A powerpoint presentation on the Revised K-10 Science Shaping Paper
PDF
IGGE1 Understanding the Self1234567891011
PDF
advance database management system book.pdf
PDF
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
PPTX
Share_Module_2_Power_conflict_and_negotiation.pptx
PDF
International_Financial_Reporting_Standa.pdf
PDF
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
PDF
What if we spent less time fighting change, and more time building what’s rig...
PDF
My India Quiz Book_20210205121199924.pdf
PDF
Complications of Minimal Access-Surgery.pdf
PPTX
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
PDF
Paper A Mock Exam 9_ Attempt review.pdf.
PDF
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
Cambridge-Practice-Tests-for-IELTS-12.docx
David L Page_DCI Research Study Journey_how Methodology can inform one's prac...
Unit 4 Computer Architecture Multicore Processor.pptx
Hazard Identification & Risk Assessment .pdf
HVAC Specification 2024 according to central public works department
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
Computer Architecture Input Output Memory.pptx
A powerpoint presentation on the Revised K-10 Science Shaping Paper
IGGE1 Understanding the Self1234567891011
advance database management system book.pdf
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
Share_Module_2_Power_conflict_and_negotiation.pptx
International_Financial_Reporting_Standa.pdf
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
What if we spent less time fighting change, and more time building what’s rig...
My India Quiz Book_20210205121199924.pdf
Complications of Minimal Access-Surgery.pdf
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
Paper A Mock Exam 9_ Attempt review.pdf.
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf

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.