SlideShare ist ein Scribd-Unternehmen logo
1 von 33
Introduction to Javascript
History of Javascript First appeared in 1995 Main purpose was Input validation Netscape Navigator 3 Cmm -> ScriptEase -> Expresso Pages Brendan Eich Mocha -> LiveScript -> Javascript IE 3 & Jscript ECMAScript – 1997
Javascript Implementation The Core (ECMAScript) Document Object Model (DOM) Browser Object Model (BOM)
Implementations of ECMAScript Javascript JScript ActionScript Ejscript JSCript 3.0
DOM API for XML & HTML documents Hierarchy of Nodes
<html> 	<head> 		<title>DOM Example</title> 	</head> 	<body> 		<p>Welcome to the DOM</p> 	</body> </html>​ HTML Document
HTML 	HEAD 		TITLE 			DOM Example 	BODY 		P 			Welcome to the DOM DOM Hierarchy Representation
DOM Control of Content & Structure Add, remove and modify nodes Standards Levels DOM Level 0 DOM Level 1 DOM Level 2 DOM Level 3
DOM Level 0 Netscape Navigator 3 & IE 3 Primitive  Level 1 DOM Core DOM HTML
DOM Level 2 Views Events Styles Traversal Range
DOM Level 3 DOM Load & Save DOM Validation Xpath XML Base
DOM Other DOMs Scalable Vector Graphics (SVG) Mathematical Markup Language (MathML) Synchronized Multimedia Integration Language (SMIL)
DOM Browser Support Level 0 Netscape Navigator 4 Internet Explorer 4 Opera 1 – 6 Level 1 Netscape Navigator 6+ Internet Explorer 5+ Opera 7+ Safari
DOM Browser Support Cont.. Level 2 Internet Explorer 8 Safari 2+ Chrome Opera 7+ Level 3 Safari 3+ Chrome 2+ Firefox 1+ Opera 9+
BOM Internet Explorer 3 Interact with the Browser No Standards
BOM Opening windows – window.open Move, resize & close windows Navigator object  location object screen object Cookie XMLHttpRequest
Browser Engines Trident Gecko WebKit KHTML Presto
Javascript Language ECMAScript 3rd Edition C, Perl Syntax Case Sensitive
Identifiers A-Z, a-z, 0-9, $, _ Cannot use Keywords and reserved words Comments //single-line comments /* */ multi-line comments
Statements Ends with ; is optional but recommended var sum = a + b var difference = a – b;
 Statements Multiple statements  wrap in { } if (true === true) { varmsg = “hello”; alert(msg + “world”); }
break		else		new		var case		finally		return		void catch		for		switch		while continue		function		this		with default		if		throw delete		in		try do		instanceoftypeof Keywords
abstract		enumint		short boolean		export		interface		static byte		extends		long		super char		final		native		synchronized class		float		package		throws constgoto		private		transient debugger		implements	protected		volatile double		import		public Reserved Words
Variables Loosely typed Can hold any data Can be modified and contain different type of value ‘var’ scope
function myFunction () { varmyVariables = ‘some string’; } alert(myVariables); //undefined var a = 1, b = ‘hello’, myArray = {};
Datatypes Five primitive datatypes Undefined Null Boolean Number String ‘typeof’ operator ‘objects’
Undefined var temp; alert(temp); 		//undefined alert(typeof temp === ‘undefined’) //true
Null Empty object pointer var temp = null; alert(null == undefined) //true alert(null === undefined) //false
Boolean Boolean() 		      true		false String		non-empty string	empty string Number		non-zero		0 Object		any object Undefined – false Null - false
Number Integers & floating point values varintNum = 100;		//integer varoctNum = 070;		//Octal for 56 varhexNum = 0xA;		//Hex for 10 var floatNum1 = 1.1;		//float var floatNum2 = 1.;		//1 integer var floatNum3 = 0.1;		//1 integer varlrgFloat = 3.125e7;	//31250000 			//3.125 * 10^7
Number NaN – not a number isNaN() NaN === NaN isNaN(NaN);			//true isNaN(10);			//false isNaN(’10’);			//false isNaN(‘cool’);		//true isNaN(true);			//false
Number Number() Number.MIN_VALUE NUMBER.MAX_VALUE Infinity isFinite()
String Object

Weitere Àhnliche Inhalte

Was ist angesagt?

An Introduction to JavaScript
An Introduction to JavaScriptAn Introduction to JavaScript
An Introduction to JavaScript
tonyh1
 
Javascript - Tutorial
Javascript - TutorialJavascript - Tutorial
Javascript - Tutorial
adelaticleanu
 

Was ist angesagt? (20)

JavaScript
JavaScriptJavaScript
JavaScript
 
Introduction to JavaScript Basics.
Introduction to JavaScript Basics.Introduction to JavaScript Basics.
Introduction to JavaScript Basics.
 
JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...
JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...
JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...
 
Javascript 101
Javascript 101Javascript 101
Javascript 101
 
PHP Basics
PHP BasicsPHP Basics
PHP Basics
 
Intro to Javascript
Intro to JavascriptIntro to Javascript
Intro to Javascript
 
Javascript functions
Javascript functionsJavascript functions
Javascript functions
 
Javascript Basics
Javascript BasicsJavascript Basics
Javascript Basics
 
Introduction To JavaScript
Introduction To JavaScriptIntroduction To JavaScript
Introduction To JavaScript
 
An Introduction to JavaScript
An Introduction to JavaScriptAn Introduction to JavaScript
An Introduction to JavaScript
 
Javascript - Tutorial
Javascript - TutorialJavascript - Tutorial
Javascript - Tutorial
 
JS Event Loop
JS Event LoopJS Event Loop
JS Event Loop
 
JavaScript Basics
JavaScript BasicsJavaScript Basics
JavaScript Basics
 
JS - Basics
JS - BasicsJS - Basics
JS - Basics
 
eXo SEA - JavaScript Introduction Training
eXo SEA - JavaScript Introduction TrainingeXo SEA - JavaScript Introduction Training
eXo SEA - JavaScript Introduction Training
 
JavaScript Basics
JavaScript BasicsJavaScript Basics
JavaScript Basics
 
Basics of JavaScript
Basics of JavaScriptBasics of JavaScript
Basics of JavaScript
 
3. Java Script
3. Java Script3. Java Script
3. Java Script
 
A Re-Introduction to JavaScript
A Re-Introduction to JavaScriptA Re-Introduction to JavaScript
A Re-Introduction to JavaScript
 
Fundamental JavaScript [UTC, March 2014]
Fundamental JavaScript [UTC, March 2014]Fundamental JavaScript [UTC, March 2014]
Fundamental JavaScript [UTC, March 2014]
 

Andere mochten auch (6)

Knockout
KnockoutKnockout
Knockout
 
JavaScript: a very short introduction
JavaScript: a very short introductionJavaScript: a very short introduction
JavaScript: a very short introduction
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascript
 
Javascript basics for automation testing
Javascript  basics for automation testingJavascript  basics for automation testing
Javascript basics for automation testing
 
JavaScript Introduction
JavaScript IntroductionJavaScript Introduction
JavaScript Introduction
 
Js ppt
Js pptJs ppt
Js ppt
 

Ähnlich wie Javascript session 01 - Introduction to Javascript

PHPDoc
PHPDocPHPDoc
PHPDoc
pjfiers
 
JavaScript and jQuery Fundamentals
JavaScript and jQuery FundamentalsJavaScript and jQuery Fundamentals
JavaScript and jQuery Fundamentals
BG Java EE Course
 
Speed up your developments with Symfony2
Speed up your developments with Symfony2Speed up your developments with Symfony2
Speed up your developments with Symfony2
Hugo Hamon
 
Boost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
Boost Your Environment With XMLDB - UKOUG 2008 - Marco GralikeBoost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
Boost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
Marco Gralike
 
course slides -- powerpoint
course slides -- powerpointcourse slides -- powerpoint
course slides -- powerpoint
webhostingguy
 

Ähnlich wie Javascript session 01 - Introduction to Javascript (20)

PHPDoc
PHPDocPHPDoc
PHPDoc
 
JavaScript
JavaScriptJavaScript
JavaScript
 
JavaScript and jQuery Fundamentals
JavaScript and jQuery FundamentalsJavaScript and jQuery Fundamentals
JavaScript and jQuery Fundamentals
 
Java 17
Java 17Java 17
Java 17
 
ActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group PresentationActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group Presentation
 
Speed up your developments with Symfony2
Speed up your developments with Symfony2Speed up your developments with Symfony2
Speed up your developments with Symfony2
 
Fundamentals of programming angeli
Fundamentals of programming angeliFundamentals of programming angeli
Fundamentals of programming angeli
 
Jsp
JspJsp
Jsp
 
Mxhr
MxhrMxhr
Mxhr
 
Boost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
Boost Your Environment With XMLDB - UKOUG 2008 - Marco GralikeBoost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
Boost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
 
Javascript
JavascriptJavascript
Javascript
 
Processing XML with Java
Processing XML with JavaProcessing XML with Java
Processing XML with Java
 
Javazone 2010-lift-framework-public
Javazone 2010-lift-framework-publicJavazone 2010-lift-framework-public
Javazone 2010-lift-framework-public
 
Rapid JCR Applications Development with Sling
Rapid JCR Applications Development with SlingRapid JCR Applications Development with Sling
Rapid JCR Applications Development with Sling
 
How Xslate Works
How Xslate WorksHow Xslate Works
How Xslate Works
 
Csphtp1 18
Csphtp1 18Csphtp1 18
Csphtp1 18
 
course slides -- powerpoint
course slides -- powerpointcourse slides -- powerpoint
course slides -- powerpoint
 
Effecient javascript
Effecient javascriptEffecient javascript
Effecient javascript
 
Intro to JavaScript
Intro to JavaScriptIntro to JavaScript
Intro to JavaScript
 
Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007
 

KĂŒrzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

KĂŒrzlich hochgeladen (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
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
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
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
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
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
 
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
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
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
 
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...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
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 ...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 

Javascript session 01 - Introduction to Javascript