JavaScript davide morelli history LiveScript (1995) in Netscape java script is a misleading name started as a scripting counterpart.

Slides:



Advertisements
Similar presentations
The JavaScript Programming Language
Advertisements

JavaScript I. JavaScript is an object oriented programming language used to add interactivity to web pages. Different from Java, even though bears some.
Intro to Javascript CS Client Side Scripting CS380 2.
Molecular Biomedical Informatics Web Programming 1.
the javascript language BY SA.
JavaScript & jQuery JavaScript and jQuery introduction.
Intro to JavaScript. JavaScript History Client (generally browser-side) language invented at Netscape under the name LiveScript around 1995 Netscape wanted.
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Web Application Development Muhammad Ali Versonic Pte Asher Imtiaz Forman Christian College.
1 CSC 551: Web Programming Spring 2004 client-side programming with JavaScript  scripts vs. programs  JavaScript vs. JScript vs. VBScript  common tasks.
Advanced JS The World's Most Misunderstood Programming Language ) Douglas Crockford( Shimon Dahan
EIW: Javascript the Language1 The JavaScript Language.
Javascript Client-side scripting. Up to now  We've seen a little about how to control  content with HTML  presentation with CSS  Javascript is a language.
25-Jun-15 JavaScript Language Fundamentals II. 2 Exception handling, I Exception handling in JavaScript is almost the same as in Java throw expression.
Squirrel Programming Language By Nandini Bhatta CS537 Summer 2008.
CS 299 – Web Programming and Design Overview of JavaScript and DOM Instructor: Dr. Fang (Daisy) Tang.
2012 •••••••••••••••••••••••••••••••••• Summer WorkShop Mostafa Badr
JAVASCRIPT Introduction Kenny Lam. What is Javascript?  Client-side scripting language that can manipulate elements in the DOM  Event-driven language.
JavaScript Demo Presented by … Jaisingh Sumit jain Sudhindra Taran Deep arora.
Object-based Programming in JavaScript By Katie Horn.
Taking JavaScript Seriously IS NOT THE WORST IDEA.
4.1 JavaScript Introduction
JavaScript JavaScript is a scripting language that is most commonly used to add client- side programming to a web page. Some of the things it is used for.
Introduction to JavaScript 11 Introduction to Programming the WWW I CMSC Winter 2004 Lecture 14.
1 JavaScript. 2 What’s wrong with JavaScript? A very powerful language, yet –Often hated –Browser inconsistencies –Misunderstood –Developers find it painful.
Arrays – What is it? – Creation – Changing the contents Functions – What is it? – Syntax – How they work – Anonymous functions A quick lesson in Objects.
Web Application Development Muhammad Ali.  The Problem  Changing the Content of Page Dynamically  Efficient Utilization of Resources.
Javascript & DOM. Javascript – main properties is a lightweight scripting language (language used to control the browser) that is run on the client-side.
JavaScript: The Language Andrew Miadowicz Program Manager DEV307.
CHAPTER 4 Java Script อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา 1.
Intro to JavaScript Scripting language –ECMAScript compliant –Client side vs. server side Syntactic rules –White space –Statement end: ; optional –Comments:
JavaScript Syntax and Semantics. Slide 2 Lecture Overview Core JavaScript Syntax (I will not review every nuance of the language)
Martin Kruliš by Martin Kruliš (v1.0)1.
Javascript. What is JavaScript? Scripting (interpreted) language designed for the web Beware: JavaScript is case sensitive.
Functions and Closures. JavaScript Closures Are Everywhere In JS we often want to say “when this thing happens, do something” event driven programming.
XP Tutorial 10New Perspectives on HTML and XHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial.
JavaScript Scripting language What is Scripting ? A scripting language, script language, or extension language is a programming language.
Prototypal Inheritance. Can We Do Inheritance Without Classes? How do we share behaviour across objects.
1 JavaScript 2.0: Evolving a Language for Evolving Systems Waldemar Horwat Netscape.
“The world’s most misunderstood language has become the world’s most popular programming language” Akshay Arora
Rich Internet Applications 2. Core JavaScript. The importance of JavaScript Many choices open to the developer for server-side Can choose server technology.
Prototype Chain and Inheritance Prototype chain, Inheritance, Accessing Base Members Software University Technical Trainers SoftUni Team.
Object Oriented JavaScript. JavaScript Really only 4 types in JavaScript – number, string, boolean – Object (includes arrays) Remember that an object.
JavaScript Introduction inf385t Semantic Web 2/20/2006.
JavaScript Katie Fowle November 15, History Brendan Eich at Netscape, 1995 Need for interactivity in web pages Mocha, LiveWire, LiveScript, then.
Introduction to Javascript. What is javascript?  The most popular web scripting language in the world  Used to produce rich thin client web applications.
Javascript Prof. Wenwen Li School of Geographical Sciences and Urban Planning 5644 Coor Hall
Introduction to.
JavaScript Introduction
Just enough to get going!
JavaScript Print slides by Sean Boyle, with overall content based on material provided by Dan Bogaard, from:
Introduction to Web Assembly
Game-Changing Features in ES2015
JavaScript for C++ and Java Programmers
JavaScript Syntax and Semantics
Davide Morelli Giuseppe Attardi Dipartimento di Informatica
JavaScript an introduction.
HCI Lab 2.
CS5220 Advanced Topics in Web Programming JavaScript Basics
University of Kurdistan
CS5220 Advanced Topics in Web Programming Node.js Basics
CS3220 Web and Internet Programming JavaScript Basics
CS5220 Advanced Topics in Web Programming More Node.js
JavaScript CS 4640 Programming Languages for Web Applications
Javascript & DOM.
Introduction To JavaScript
CS3220 Web and Internet Programming JavaScript Basics
Introduction to JavaScript
CS5220 Advanced Topics in Web Programming More Node.js
JavaScript CS 4640 Programming Languages for Web Applications
Presentation transcript:

JavaScript davide morelli

history LiveScript (1995) in Netscape java script is a misleading name started as a scripting counterpart for java in netscape battle vs Microsoft ECMAscript – current is 5.1 – harmony (6.0) server side (already present in 1994, now usable) source: wikipedia

History: WEB HTML/CSS JavaScript source:

History: the platform grew HTML/CSS JavaScript Canvas2D SVG HTML5Audio source:

History: grew some more HTML/CSS JavaScript Canvas2D SVG HTML5Audio WebGL Typed Array Web Workers Web Sockets Fullscreen source:

History: let’s get crazy HTML/CSS JavaScript Canvas2D SVG HTML5Audio WebGL Typed Array Web Workers Web Sockets Fullscreen WebRTC – 2-way low latency audio, video and data Web Audio source:

History: everything merges together emscripten – LLVM to JavaScript – compile C/C++ into JS that runs on the web – – example: ASM.JS – near native JavaScript performance – source:

History: server side recent trend in SV very effective coupled with nosql example: nodejs + mongodb

Features of the language imperative – if, loops, etc.. loosely typed dynamic – everything is an object – eval functions are objects prototype based

types string numbers booelans Date arrays objects undefined null RegExp, Math, DOM

comparison ==, != ===, !== >, >=, <, <= &&, ||, ! ? :

var dynamic typing – types associated with values, not variables var a = 1; console.log(a); a = "ciao"; console.log(a);

statements blocks scoping: javascript does NOT have block scope var a = 1; { var a = 2; } console.log(a);

flow control if switch for – (more details later..) while do

try catch try … catch throw finally

functions recursion functions are objects var foo = function(a) { return a + 1; } var a = foo; console.log(a(1)); closures var a = 1; function foo() { return a; } console.log(foo());

objects (1) several ways to create objects var a = new Object(); var b = {}; var c = { foo: 1, bar:2 } several ways to add properties b.foo = 1; a['foo']=1; properties: function are values

objects (2) functions as object constructors.. new, this var Person = function(name) { this.name = name; }; var davide = new Person('Davide'); console.log(davide.name); not classes.. prototype based Person.prototype.getName = function() { return this.name; }; var davide = new Person('Davide'); console.log(davide.getName());

objects (3) inheritance var Person = function(name) { this.name = name; }; Person.prototype.getName = function() { return this.name; }; var Student = function(name, matricolaID) { this.name = name; this.matricola = matricolaID; } Student.prototype = new Person(); var davide = new Student('Davide', 1); console.log(davide.getName());

objects (4) objects are associative arrays augmented with prototypes

Array is an object, with properties and methods added to the prototype (you can add your own) – constructor – length – push() – pop() – reverse() – join() – …

flow control if switch for – for (var i=0; i<arrayname.length; i++) {} – for (var itemkey in obj) {} – for each (var itemvalue in obj) {} while do

eval evaluates a string and returns a results var foo = 1; console.log( eval("foo + 1") );