SlideShare uma empresa Scribd logo
1 de 17
Introduction to JavaScript
HTML5, CSS3, Javascript and Jquery
by: Seshu Puvvada
1
Introduction
 What is JavaScript
 How does it work
 Any PC, any OS, any Browser
 ECMAScript 5
 ECMAScript 6/ ES6/ ES Next
 Case Sensitive
Prototype-based programming
 Class less programming
 Prototype-based programming is an OOP model that doesn't use classes, but
rather it first accomplishes the behavior of any class and then reuses it by
decorating existing prototype objects.
Script block
 Internal scripting
 <script> </script>
 External scripting
 <script src="js/filename.js"></script>
Document Vs Window
Document Object Model
AXP Internal
Simple DOM Manipulation
 What is function
 What is event
<!DOCTYPE html>
<html>
<head>
<title>Welcome to JS</title>
<script>
function changedata(){
document.getElementById('description').innerHTML = "Text has been changed";
}
</script>
</head>
<body>
<p id="description" > Testing paragraph </p>
<input type="submit" value="Change Data" onclick="changedata()">
</body>
</html>
Dynamic Typing
 JavaScript is a loosely typed or a dynamic language. That means you don't
have to declare the type of a variable ahead of time. The type will get
determined automatically while the program is being processed. That also
means that you can have the same variable as different types
 var foo = 42; // foo is now a Number
 var foo = "bar"; // foo is now a String
 var foo = true; // foo is now a Boolean
Data types
 Primitive Data type
 Boolean (true/false)
 Null (null)
 Undefined(not assigned any value)
 Number
 String
 Symbol (ES 6)
 Object
Variables
 var keyword
 Scope
 Global and local variable
 Variable declaration
 var x = 1;
 var str = ‘hai’;
 var isStr = true;
 Printing variable – console.log(var names)
 typeof -- to find variable type
Logical Operators
 == equal to
 === equal value and equal type
 != not equal
 !== not equal value or not equal type
 > greater than
 < less than
 >= greater than or equal to
 <= less than or equal to
Program Flow
 Conditional statements
 if
 if, else
 if, else, else if
 while
 do while
 for
 break
 switch
 Functions
 Function
 Function with input parameters
 Function with and without return
Object
 An Object is collection of properties. These properties can either be
primitive datatypes or other objects or functions.
 Predefined objects array, date etc…
 Custom objects
 Var obj = { };
Array
 Array – to store multiple values in single variable
 Var myarr = [‘one’, ‘two’, ‘three’];
 Accessing array items – myarr[1]
 Changing elements myarr[1]
 STACK principle – LIFO
 Properties
 Length
 Push
 Pop
 toString()
 Join(“ “)
 Shift – removed element at first place (index 0)
 Unshift – adds element at firstplace
 Splice(2, 0 , obj1, obj2) – add items at position 2, 0 don’t delete any items
 Sort – default sort
 Concat – arr1.concat(arr2) – will add arr2 to arr1
 Slice(1, 3) – slice elements from index 1 to 3.
String properties
 Str.length
 Escape char – “I am ”frontend developer””
 n – for new line
 indexOf
 lastIndexOf
 Replace
 Search
 Split – convert string to array
 Substr
 Substring
 toLowerCase
 toUpperCase
Error handling
 Try
 Catch
 Finally
 Throw
 try{
//something here
throw “custom error” ;
}catch(err){
}finally{
//something here
}
DOM Manipulation methods
AXP Internal

Mais conteúdo relacionado

Mais procurados

javascript
javascript javascript
javascript
Kaya Ota
 
Fii Practic Frontend - BeeNear - laborator3
Fii Practic Frontend - BeeNear - laborator3Fii Practic Frontend - BeeNear - laborator3
Fii Practic Frontend - BeeNear - laborator3
BeeNear
 

Mais procurados (20)

javascript objects
javascript objectsjavascript objects
javascript objects
 
OOP in JavaScript
OOP in JavaScriptOOP in JavaScript
OOP in JavaScript
 
javascript
javascript javascript
javascript
 
Object Oriented JavaScript - II
Object Oriented JavaScript - IIObject Oriented JavaScript - II
Object Oriented JavaScript - II
 
JavaScript - Chapter 8 - Objects
 JavaScript - Chapter 8 - Objects JavaScript - Chapter 8 - Objects
JavaScript - Chapter 8 - Objects
 
3.1 javascript objects_DOM
3.1 javascript objects_DOM3.1 javascript objects_DOM
3.1 javascript objects_DOM
 
Week3
Week3Week3
Week3
 
What's New in Django 1.6
What's New in Django 1.6What's New in Django 1.6
What's New in Django 1.6
 
Underscore and Backbone Models
Underscore and Backbone ModelsUnderscore and Backbone Models
Underscore and Backbone Models
 
Mobile Day - React Native
Mobile Day - React NativeMobile Day - React Native
Mobile Day - React Native
 
Object Oriented Programing in JavaScript
Object Oriented Programing in JavaScriptObject Oriented Programing in JavaScript
Object Oriented Programing in JavaScript
 
Ten useful JavaScript tips & best practices
Ten useful JavaScript tips & best practicesTen useful JavaScript tips & best practices
Ten useful JavaScript tips & best practices
 
What's new in Django 1.7
What's new in Django 1.7What's new in Django 1.7
What's new in Django 1.7
 
Scala.js - yet another what..?
Scala.js - yet another what..?Scala.js - yet another what..?
Scala.js - yet another what..?
 
Fii Practic Frontend - BeeNear - laborator3
Fii Practic Frontend - BeeNear - laborator3Fii Practic Frontend - BeeNear - laborator3
Fii Practic Frontend - BeeNear - laborator3
 
Introduction to Jquery
Introduction to Jquery Introduction to Jquery
Introduction to Jquery
 
Database programming
Database programmingDatabase programming
Database programming
 
React redux
React reduxReact redux
React redux
 
Java scriptforjavadev part2a
Java scriptforjavadev part2aJava scriptforjavadev part2a
Java scriptforjavadev part2a
 
Lecture 6: Client Side Programming 2
Lecture 6: Client Side Programming 2Lecture 6: Client Side Programming 2
Lecture 6: Client Side Programming 2
 

Destaque (11)

Jooker
JookerJooker
Jooker
 
sensi protective auto's.
sensi protective auto's.sensi protective auto's.
sensi protective auto's.
 
Guia. Primer Formato, TamañO
Guia. Primer Formato, TamañOGuia. Primer Formato, TamañO
Guia. Primer Formato, TamañO
 
Plots in neemrana behror,nh8
Plots in neemrana behror,nh8 Plots in neemrana behror,nh8
Plots in neemrana behror,nh8
 
cert compressed
cert compressedcert compressed
cert compressed
 
Tableau des manifestations 2014 mdesp
Tableau des manifestations  2014 mdespTableau des manifestations  2014 mdesp
Tableau des manifestations 2014 mdesp
 
OLABISI RAIMI - CV May 2015
OLABISI RAIMI - CV May 2015OLABISI RAIMI - CV May 2015
OLABISI RAIMI - CV May 2015
 
UCM Dean's List
UCM Dean's ListUCM Dean's List
UCM Dean's List
 
Impact of sales promotion
Impact of sales promotionImpact of sales promotion
Impact of sales promotion
 
Plantilla evaluación individual tutores intef
Plantilla evaluación individual tutores intefPlantilla evaluación individual tutores intef
Plantilla evaluación individual tutores intef
 
Auto biography
Auto biographyAuto biography
Auto biography
 

Semelhante a Introduction to JavaScrtipt

JavaScript (without DOM)
JavaScript (without DOM)JavaScript (without DOM)
JavaScript (without DOM)
Piyush Katariya
 
Qtp training session IV
Qtp training session IVQtp training session IV
Qtp training session IV
Aisha Mazhar
 
JavaScript Growing Up
JavaScript Growing UpJavaScript Growing Up
JavaScript Growing Up
David Padbury
 

Semelhante a Introduction to JavaScrtipt (20)

Art of Javascript
Art of JavascriptArt of Javascript
Art of Javascript
 
JavaScript (without DOM)
JavaScript (without DOM)JavaScript (without DOM)
JavaScript (without DOM)
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascript
 
Introduction to Client-Side Javascript
Introduction to Client-Side JavascriptIntroduction to Client-Side Javascript
Introduction to Client-Side Javascript
 
AJS UNIT-1 2021-converted.pdf
AJS UNIT-1 2021-converted.pdfAJS UNIT-1 2021-converted.pdf
AJS UNIT-1 2021-converted.pdf
 
A Deeper look into Javascript Basics
A Deeper look into Javascript BasicsA Deeper look into Javascript Basics
A Deeper look into Javascript Basics
 
Java script advance-auroskills (2)
Java script advance-auroskills (2)Java script advance-auroskills (2)
Java script advance-auroskills (2)
 
JavaScript Basics - GameCraft Training
JavaScript Basics - GameCraft TrainingJavaScript Basics - GameCraft Training
JavaScript Basics - GameCraft Training
 
Qtp training session IV
Qtp training session IVQtp training session IV
Qtp training session IV
 
Twins: OOP and FP
Twins: OOP and FPTwins: OOP and FP
Twins: OOP and FP
 
Scala - core features
Scala - core featuresScala - core features
Scala - core features
 
Java tutorials
Java tutorialsJava tutorials
Java tutorials
 
Barcamp Auckland Rails3 presentation
Barcamp Auckland Rails3 presentationBarcamp Auckland Rails3 presentation
Barcamp Auckland Rails3 presentation
 
Scala for Java Developers
Scala for Java DevelopersScala for Java Developers
Scala for Java Developers
 
Wt unit 2 ppts client sied technology
Wt unit 2 ppts client sied technologyWt unit 2 ppts client sied technology
Wt unit 2 ppts client sied technology
 
Wt unit 2 ppts client side technology
Wt unit 2 ppts client side technologyWt unit 2 ppts client side technology
Wt unit 2 ppts client side technology
 
JavaScript Growing Up
JavaScript Growing UpJavaScript Growing Up
JavaScript Growing Up
 
Java Tutorial | My Heart
Java Tutorial | My HeartJava Tutorial | My Heart
Java Tutorial | My Heart
 
JavsScript OOP
JavsScript OOPJavsScript OOP
JavsScript OOP
 
Java Script ppt
Java Script pptJava Script ppt
Java Script ppt
 

Último

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 

Introduction to JavaScrtipt

  • 1. Introduction to JavaScript HTML5, CSS3, Javascript and Jquery by: Seshu Puvvada 1
  • 2. Introduction  What is JavaScript  How does it work  Any PC, any OS, any Browser  ECMAScript 5  ECMAScript 6/ ES6/ ES Next  Case Sensitive
  • 3. Prototype-based programming  Class less programming  Prototype-based programming is an OOP model that doesn't use classes, but rather it first accomplishes the behavior of any class and then reuses it by decorating existing prototype objects.
  • 4. Script block  Internal scripting  <script> </script>  External scripting  <script src="js/filename.js"></script>
  • 7. Simple DOM Manipulation  What is function  What is event <!DOCTYPE html> <html> <head> <title>Welcome to JS</title> <script> function changedata(){ document.getElementById('description').innerHTML = "Text has been changed"; } </script> </head> <body> <p id="description" > Testing paragraph </p> <input type="submit" value="Change Data" onclick="changedata()"> </body> </html>
  • 8. Dynamic Typing  JavaScript is a loosely typed or a dynamic language. That means you don't have to declare the type of a variable ahead of time. The type will get determined automatically while the program is being processed. That also means that you can have the same variable as different types  var foo = 42; // foo is now a Number  var foo = "bar"; // foo is now a String  var foo = true; // foo is now a Boolean
  • 9. Data types  Primitive Data type  Boolean (true/false)  Null (null)  Undefined(not assigned any value)  Number  String  Symbol (ES 6)  Object
  • 10. Variables  var keyword  Scope  Global and local variable  Variable declaration  var x = 1;  var str = ‘hai’;  var isStr = true;  Printing variable – console.log(var names)  typeof -- to find variable type
  • 11. Logical Operators  == equal to  === equal value and equal type  != not equal  !== not equal value or not equal type  > greater than  < less than  >= greater than or equal to  <= less than or equal to
  • 12. Program Flow  Conditional statements  if  if, else  if, else, else if  while  do while  for  break  switch  Functions  Function  Function with input parameters  Function with and without return
  • 13. Object  An Object is collection of properties. These properties can either be primitive datatypes or other objects or functions.  Predefined objects array, date etc…  Custom objects  Var obj = { };
  • 14. Array  Array – to store multiple values in single variable  Var myarr = [‘one’, ‘two’, ‘three’];  Accessing array items – myarr[1]  Changing elements myarr[1]  STACK principle – LIFO  Properties  Length  Push  Pop  toString()  Join(“ “)  Shift – removed element at first place (index 0)  Unshift – adds element at firstplace  Splice(2, 0 , obj1, obj2) – add items at position 2, 0 don’t delete any items  Sort – default sort  Concat – arr1.concat(arr2) – will add arr2 to arr1  Slice(1, 3) – slice elements from index 1 to 3.
  • 15. String properties  Str.length  Escape char – “I am ”frontend developer””  n – for new line  indexOf  lastIndexOf  Replace  Search  Split – convert string to array  Substr  Substring  toLowerCase  toUpperCase
  • 16. Error handling  Try  Catch  Finally  Throw  try{ //something here throw “custom error” ; }catch(err){ }finally{ //something here }

Notas do Editor

  1. Primitive Data type – is data that is not an object and has no methods. s