ES Promise.

Size: px
Start display at page:

Download "ES Promise."

Transcription

1 ES Promise

2 A Promise represents a value which may be available now, or in the future, or never. Promise A Promise is a proxy for a value not necessarily known when the promise is created. It allows you to associate handlers to an asynchronous action's eventual success value or failure reason.

3 ECMA Script Promise

4

5 var promise = new Promise(function(resolve, reject) { // call resolve or reject }); promise.then(function(value) { // work with value }, function(error) { // on error }); Basic usage (I)

6 function get(url) { return new Promise(function(resolve, reject) { var req = new XMLHttpRequest(); req.open('get', url); req.onload = function() { if (req.status == 200) { resolve(req.response); } else { reject(error(req.statustext)); } }; req.onerror = function() { reject(error("network Error")); }; req.send(); }); } Basic usage (II)

7 function get(url) { return new Promise(function(resolve, reject) { var req = new XMLHttpRequest(); req.open('get', url); req.onload = function() { if (req.status == 200) { resolve(req.response); } else { reject(error(req.statustext)); } }; req.onerror = function() { reject(error("network Error")); }; req.send(); }); } Basic usage (III)

8

9 [ { "id": , "name": "ember-sokoban",... }, { "id": , "name": "tajpado",... },... ]

10 get(' { var repos = JSON.parse(response); console.log(repos.map(repo => repo.name)); }); Basic usage (IV)

11

12 Y si hay un error en la petición?

13 function get(url) { return new Promise(function(resolve, reject) { var req = new XMLHttpRequest(); req.open('get', url); req.onload = function() { if (req.status == 200) { resolve(req.response); } else { reject(error(req.statustext)); } }; req.onerror = function() { reject(error("network Error")); }; req.send(); }); }

14 get(' { var repos = JSON.parse(response); console.log(repos.map(repo => repo.name)); }, function(error) { console.warn(error); }); Error handling (I)

15 get(' { var repos = JSON.parse(response); console.log(repos.map(repo => repo.name)); }).catch(function(error) { console.warn(error); }); Error handling (II)

16 .catch(function(reason) {}) =.then(undefined, function(reason) {}) Error handling (III)

17 get(' { return JSON.parse(response); }).then(function(repos) { return repos.map(repo => repo.name); }).then(function(names) { console.log(names); }); Transforming values (I)

18 get(' { return repos.map(repo => repo.name); }).then(console.log); Transforming values (II)

19 get(' { return get(repo.stargazers_url); }).then(json.parse).then(function(stars) { console.log(stars.length); }); Queuing async actions (I)

20 get(' { return get(repo.stargazers_url); }).then(json.parse).then(function(stars) { console.log(stars.length); }); Queuing async actions (II)

21 get(' { //... then 1 }).catch(function(error) { //... catch 1 }).then(function(message) { //... then 2 }); Ejercicio para el lector

22 get('...') Then 1 Catch 1 Then 2 Done Unhandled error

23 Promise.all([ get(' get(' ]).then(function(responses) { // array of responses }); Promise.all(iterable)

24 Promise.race([ get(' get(' ]).then(function(response) { // only one response }); Promise.race(iterable)

25 Promise.resolve('a dummy value'); Promise.resolve(value)

26 Promise.reject(Error('a failed promise')); Promise.reject(reason)

27 ECMAScript Promise new Promise(function(resolve, reject)) then, catch chaining Promise.all Promise.race Promise.resolve Promise.reject

28 RSVP.Promise

29

30

31 function get(url) { return new RSVP.Promise(function(resolve, reject) { var req = new XMLHttpRequest(); req.open('get', url); req.onload = function() { if (req.status == 200) { resolve(req.response); } else { reject(error(req.statustext)); } }; req.onerror = function() { reject(error("network Error")); }; req.send(); }); } Basic usage (I)

32 function get(url) { return new RSVP.Promise(function(resolve, reject) { var req = new XMLHttpRequest(); req.open('get', url); req.onload = function() { if (req.status == 200) { resolve(req.response); } else { reject(error(req.statustext)); } }; req.onerror = function() { reject(error("network Error")); }; req.send(); }); } Basic usage (II)

33 var deferred = RSVP.defer(); //... deferred.promise // access the promise //... deferred.resolve(); Deferred (I)

34 var deferred = RSVP.defer(); btn.onclick = function() { deferred.resolve(42); }; deferred.promise.then(function(value) { console.log(`the answer to life the universe and everything is ${value}`); }); Deferred (II)

35 get(' { // process }).catch(function(error) { // an error }).finally(function() { // always runs }); finally

36 RSVP.hash({ ceibo: get(' ombu: get(' }).then(function(data) { // data.ceibo // data.ombu }); RSVP.hash

37 RSVP.hashSettled({ ceibo: get(' ombu: get(' }).then(function(data) { // data.ceibo -> { state: 'fulfilled', value: value } // data.ombu -> { state: 'rejected', reason: reason } }); RSVP.hashSettled

38 RSVP.allSettled([ get(' get(' ]).then(function(responses) { // responses[0] -> { state: 'fulfilled', value: value } // responses[1] -> { state: 'rejected', reason: reason } }); RSVP.allSettled

39 RSVP.on('created', function(event) { // event.detail // event.label //... }); RSVP.on('fulfilled', function(event) { //... }); RSVP.on('rejected', function(event) { //... }); Instrumentation

40 new RSVP.Promise(function(resolve, reject) {}, "a label"); RSVP.Promise.resolve('a value', 'a label'); RSVP.on('created', function(event) { // event.label }); Labelling

41 RSVP.on('error', function(reason, label) { if (label) { console.error(label); } console.assert(false, reason); }); Unhandled errors

42 RSVP.Promise Deferred finally RSVP.hash RSVP.allSettled RSVP.hashSettled RSVP.on(...) instrumentation RSVP.on('error') unhandled errors labelling

43 Bluebird

44

45

46 get(' function() { // could not get response within 100ms }).catch(function() { // different error }); timeout

47 get(' function() { // could not get response within 100ms }).catch(function() { // different error }); Catch with "type matching"

48 function get(url) { return new Promise(function(resolve, reject, oncancel) { var xhr = new XMLHttpRequest();... oncancel(function() { xhr.abort(); }); }); } Cancellation

49 Y mil cosas más...

50 Problemas, futures y observables

51 Problemas...

52 var promise = get(' btn.onclick = function() { promise.cancel(); // nope :-( }; Cancellation

53 var promise = new Promise(function(resolve, reject) { //... }).then(function() { //... }).then(function() { //... }).then(function() { //... }).then(function() { //... }); Performance

54 get(' { return JSON.parse(response); }).then(function(repos) { return repos.map(repo => repo.name); }).then(function(names) { console.log(names); }); Inconsistencias, no es lo mismo retornar un valor que retornar una promesa

55 Problemas No se pueden cancelar No son lazy, la función executor se ejecuta siempre Performance Inconsistencias, no es lo mismo retornar un valor que retornar una promesa

56 Futures

57 Futures (Fluture) Much like Promises, Futures represent the value arising from the success or failure of an asynchronous operation (I/O). Though unlike Promises Futures are lazy and monadic by design. They conform to the Fantasy Land algebraic JavaScript specification.

58

59

60 new Promise((res) => settimeout(200, res, 'Hello')).then(x => `${x} world!`).then(x => get('/foo')).then(console.log, console.error); // -----Future((rej, res) => settimeout(200, res, 'Hello')).map(x => `${x} world!`).chain(x => get('/foo')).fork(console.error, console.log);

61 Observable

62 Observable (RxJS) Is a set of libraries to compose asynchronous and event-based programs using observable collections and Array#extras style composition in JavaScript. Some differences with promises 0 or many values Sync or async Lazy Can be cancelled

63 // Get stock data somehow const source = getasyncstockdata(); const subscription = source.filter(quote => quote.price > 30).map(quote => quote.price).foreach(price => console.log(`prices higher than $30: ${price}`);

64

65

Asynchronous Programming in Javascript, Part 2. CSCI 5828: Foundations of Software Engineering Lecture 19 10/25/2016

Asynchronous Programming in Javascript, Part 2. CSCI 5828: Foundations of Software Engineering Lecture 19 10/25/2016 Asynchronous Programming in Javascript, Part 2 CSCI 5828: Foundations of Software Engineering Lecture 19 10/25/2016 1 Goals Discussed asynchronous programming in Javascript in Lecture 18 The gap between

More information

Package promises. April 13, 2018

Package promises. April 13, 2018 Type Package Package promises April 13, 2018 Title Abstractions for Promise-Based Asynchronous Programming Version 1.0.1 Provides fundamental abstractions for doing asynchronous programming in R using

More information

TERSUBSCRIBE. E s s e n t i a l f o r s o f t w a r e t e s t e r s. It s FREE for testers. June / 5 v2.0 number 27

TERSUBSCRIBE. E s s e n t i a l f o r s o f t w a r e t e s t e r s. It s FREE for testers. June / 5 v2.0 number 27 TE It s FREE for testers TERSUBSCRIBE E s s e n t i a l f o r s o f t w a r e t e s t e r s June 2014 4 / 5 v2.0 number 27 Including articles by: Bogdan Bereza VictO Jim Pelech and Gregory Solovey Alcatel-Lucent

More information

CSP IN JAVASCRIPT.

CSP IN JAVASCRIPT. CSP IN JAVASCRIPT Page 1 of 31 VINCENZO CHIANESE BUGS INTRODUCER AT APIARY https://github.com/xvincentx @D3DVincent https://vncz.js.org Page 2 of 31 COMMUNICATING SEQUENTIAL PROCESSES Page 3 of 31 THE

More information

Asynchronous JS. SWE 432, Fall Web Application Development

Asynchronous JS. SWE 432, Fall Web Application Development Asynchronous JS SWE 432, Fall 2018 Web Application Development Review: Asynchronous Synchronous: Make a function call When function call returns, the work is done Asynchronous: Make a function call Function

More information

Module 5 JavaScript, AJAX, and jquery. Module 5. Module 5 Contains an Individual and Group component

Module 5 JavaScript, AJAX, and jquery. Module 5. Module 5 Contains an Individual and Group component Module 5 JavaScript, AJAX, and jquery Module 5 Contains an Individual and Group component Both are due on Wednesday October 24 th Start early on this module One of the most time consuming modules in the

More information

A synchronous J avascript A nd X ml

A synchronous J avascript A nd X ml A synchronous J avascript A nd X ml The problem AJAX solves: How to put data from the server onto a web page, without loading a new page or reloading the existing page. Ajax is the concept of combining

More information

ES7. The Evolution of JavaScript

ES7. The Evolution of JavaScript ES7 The Evolution of JavaScript Who is Jafar Husain? Architect of Falcor, Netflix s OSS data platform Netflix representative TC-39 Formerly worked for MS and GE ES6 spec will be finalized in June 2015

More information

Hi I m Jamund and I love ES6 and I m giving this talk.

Hi I m Jamund and I love ES6 and I m giving this talk. ES6 for Everyone Hi I m Jamund and I love ES6 and I m giving this talk. Why are you here?» Node.js People?» UI Engineers?» Designers?» Web Devs?» Non-technical folks? A LITTLE HISTORY OF JavaScript JavaScript

More information

ECMAScript 2015 The Future of JavaScript is Now!

ECMAScript 2015 The Future of JavaScript is Now! ECMAScript 2015 The Future of JavaScript is Now! Tom Van Cutsem SPLASH-I 2015 @tvcutsem Talk Outline Part I: JavaScript s origins, and the long road to ECMAScript 6 Part II: a brief tour of ECMAScript

More information

Index. Bare-bones connect application, 125 Binary JSON (BSON), 171. Callback functions asynchronous code ifelse, 199 loops,

Index. Bare-bones connect application, 125 Binary JSON (BSON), 171. Callback functions asynchronous code ifelse, 199 loops, Index A Amazon Web Services (AWS) console, 260 261 EBS, 262 EC2 Amazon Linux AMI, 262, 265 connect script and sample usage, 271 dashboard and Launch Instance, 265 global package installation, 273 hard

More information

Actinium: A RESTful Runtime Container for Scriptable Internet of Things Applications

Actinium: A RESTful Runtime Container for Scriptable Internet of Things Applications Actinium: A RESTful Runtime Container for Scriptable Internet of Things Applications, Martin Lanter, and Simon Duquennoy kovatsch@inf.ethz.ch Friday, 26 Oct 2012 Internet of Things 2012, Wuxi, China Wireless

More information

Session 11. Ajax. Reading & Reference

Session 11. Ajax. Reading & Reference Session 11 Ajax Reference XMLHttpRequest object Reading & Reference en.wikipedia.org/wiki/xmlhttprequest Specification developer.mozilla.org/en-us/docs/web/api/xmlhttprequest JavaScript (6th Edition) by

More information

Typing and Semantics of Asynchronous Arrows in JavaScript

Typing and Semantics of Asynchronous Arrows in JavaScript Typing and Semantics of Asynchronous Arrows in JavaScript Eric Fritz, Tian Zhao University of Wisconsin Milwaukee Abstract Asynchronous programs in JavaScript using callbacks and promises are dicult to

More information

CL_55244 JavaScript for Developers

CL_55244 JavaScript for Developers www.ked.com.mx Av. Revolución No. 374 Col. San Pedro de los Pinos, C.P. 03800, México, CDMX. Tel/Fax: 52785560 Por favor no imprimas este documento si no es necesario. About this course. This course is

More information

MS_ Programming in HTML5 with JavaScript and CSS3.

MS_ Programming in HTML5 with JavaScript and CSS3. Programming in HTML5 with JavaScript and CSS3 www.ked.com.mx Av. Revolución No. 374 Col. San Pedro de los Pinos, C.P. 03800, México, CDMX. Tel/Fax: 52785560 Por favor no imprimas este documento si no es

More information

JavaScript Performance QCon San Francisco, Nov 8, 2012

JavaScript Performance QCon San Francisco, Nov 8, 2012 JavaScript Performance Pa1erns @stoyanstefanov QCon San Francisco, Nov 8, 2012 JavaScript Performance Pa1erns Importance of Performance h1p://bookofspeed.com Importance of JavaScript Performance h1p://h1parchive.org

More information

JavaScript CoAPRequest API

JavaScript CoAPRequest API JavaScript CoAPRequest API Abstract The CoAPRequest specification defines an API that provides scripted client functionality for transferring data between a CoAP client and a CoAP server. Table of Contents

More information

Input and Validation. Mendel Rosenblum. CS142 Lecture Notes - Input

Input and Validation. Mendel Rosenblum. CS142 Lecture Notes - Input Input and Validation Mendel Rosenblum Early web app input: HTTP form tag Product: Deluxe:

More information

The Promised Land: Untangling Async Spaghetti Code

The Promised Land: Untangling Async Spaghetti Code The Promised Land: Untangling Async Spaghetti Code Presented by Trevor Burnham at FluentConf 2012 Preface The Compleat History of JavaScript (in about a minute) 1995: JavaScript discovered 2001: pg says

More information

Copyright Descriptor Systems, Course materials may not be reproduced in whole or in part without prior written consent of Joel Barnum

Copyright Descriptor Systems, Course materials may not be reproduced in whole or in part without prior written consent of Joel Barnum Ajax The notion of asynchronous request processing using the XMLHttpRequest object has been around for several years, but the term "AJAX" was coined by Jesse James Garrett of Adaptive Path. You can read

More information

JavaScript Programming

JavaScript Programming JavaScript Programming Course ISI-1337B - 5 Days - Instructor-led, Hands on Introduction Today, JavaScript is used in almost 90% of all websites, including the most heavilytrafficked sites like Google,

More information

Session 11. Calling Servlets from Ajax. Lecture Objectives. Understand servlet response formats

Session 11. Calling Servlets from Ajax. Lecture Objectives. Understand servlet response formats Session 11 Calling Servlets from Ajax 1 Lecture Objectives Understand servlet response formats Text Xml Html JSON Understand how to extract data from the XMLHttpRequest object Understand the cross domain

More information

Callbacks & Promises

Callbacks & Promises Callbacks & Promises Agenda Task: read a JSON file A Callback Based Library (fs) A Promise based Libdary (fs-readfile-promise) Function Styles: Anonymous function Named function Function Object Named Arrow

More information

ECMAScript 2015 and beyond The Future of JavaScript is Now!

ECMAScript 2015 and beyond The Future of JavaScript is Now! ECMAScript 2015 and beyond The Future of JavaScript is Now! Tom Van Cutsem JS.BE Meetup @tvcutsem Talk Outline Part I: 20 years of JavaScript (or, the long road to ECMAScript 6) Part II: a brief tour of

More information

AJAX: Asynchronous Event Handling Sunnie Chung

AJAX: Asynchronous Event Handling Sunnie Chung AJAX: Asynchronous Event Handling Sunnie Chung http://adaptivepath.org/ideas/ajax-new-approach-web-applications/ http://stackoverflow.com/questions/598436/does-an-asynchronous-call-always-create-call-a-new-thread

More information

Monads in Javascript. Jana Karcheska Netcetera, Skopje

Monads in Javascript. Jana Karcheska Netcetera, Skopje Monads in Javascript Jana Karcheska Netcetera, Skopje What makes apps messy? Impurity Nulls Callbacks Errors Side effects Stay pure Separate the pure from the impure Date, random DOM manipulation Handling

More information

What is Node.js? Tim Davis Director, The Turtle Partnership Ltd

What is Node.js? Tim Davis Director, The Turtle Partnership Ltd What is Node.js? Tim Davis Director, The Turtle Partnership Ltd About me Co-founder of The Turtle Partnership Working with Notes and Domino for over 20 years Working with JavaScript technologies and frameworks

More information

Propedéutico de Programación

Propedéutico de Programación Propedéutico de Programación Coordinación de Ciencias Computacionales Semana 4, Segunda Parte Dra. Pilar Gómez Gil Versión 1. 24.06.08 http://ccc.inaoep.mx/~pgomez/cursos/programacion/ Chapter 3 ADT Unsorted

More information

Module7: AJAX. Click, wait, and refresh user interaction. Synchronous request/response communication model. Page-driven: Workflow is based on pages

Module7: AJAX. Click, wait, and refresh user interaction. Synchronous request/response communication model. Page-driven: Workflow is based on pages INTERNET & WEB APPLICATION DEVELOPMENT SWE 444 Fall Semester 2008-2009 (081) Module7: Objectives/Outline Objectives Outline Understand the role of Learn how to use in your web applications Rich User Experience

More information

Frontend II: Javascript and DOM Programming. Wednesday, January 7, 15

Frontend II: Javascript and DOM Programming. Wednesday, January 7, 15 6.148 Frontend II: Javascript and DOM Programming Let s talk about Javascript :) Why Javascript? Designed in ten days in December 1995! How are they similar? Javascript is to Java as hamster is to ham

More information

Index. Symbols. accessor properties, 74,

Index. Symbols. accessor properties, 74, Index Symbols * (asterisk), 139 142, 157, 159, 175 ** (exponentiation operator), 306 307 \ (backslash), 26 ` (backtick), 26 : (colon), 69, 88 {} (curly braces), 56 57, 88 89, 285 ${ } (substitution delimiters),

More information

Fall Semester (081) Module7: AJAX

Fall Semester (081) Module7: AJAX INTERNET & WEB APPLICATION DEVELOPMENT SWE 444 Fall Semester 2008-2009 (081) Module7: AJAX Dr. El-Sayed El-Alfy Computer Science Department King Fahd University of Petroleum and Minerals alfy@kfupm.edu.sa

More information

JavaScript. The Bad Parts. Patrick Behr

JavaScript. The Bad Parts. Patrick Behr JavaScript The Bad Parts Patrick Behr History Created in 1995 by Netscape Originally called Mocha, then LiveScript, then JavaScript It s not related to Java ECMAScript is the official name Many implementations

More information

JavaScript Patterns O'REILLY* S toy an Stefanov. Sebastopol. Cambridge. Tokyo. Beijing. Farnham K8ln

JavaScript Patterns O'REILLY* S toy an Stefanov. Sebastopol. Cambridge. Tokyo. Beijing. Farnham K8ln JavaScript Patterns S toy an Stefanov O'REILLY* Beijing Cambridge Farnham K8ln Sebastopol Tokyo Table of Contents Preface xiii 1. Introduction 1 Patterns 1 JavaScript: Concepts 3 Object-Oriented 3 No Classes

More information

MarkLogic Server. Node.js Application Developer s Guide. MarkLogic 9 May, Copyright 2017 MarkLogic Corporation. All rights reserved.

MarkLogic Server. Node.js Application Developer s Guide. MarkLogic 9 May, Copyright 2017 MarkLogic Corporation. All rights reserved. Node.js Application Developer s Guide 1 MarkLogic 9 May, 2017 Last Revised: 9.0-2, July, 2017 Copyright 2017 MarkLogic Corporation. All rights reserved. Table of Contents Table of Contents Node.js Application

More information

High Performance Single Page Application with Vue.js

High Performance Single Page Application with Vue.js High Performance Single Page Application with Vue.js Premise Static HTML and simple web-pages are already a history now. The novel web applications are advanced and do a lots of functionalities. Also,

More information

AJAX Programming Chris Seddon

AJAX Programming Chris Seddon AJAX Programming Chris Seddon seddon-software@keme.co.uk 2000-12 CRS Enterprises Ltd 1 2000-12 CRS Enterprises Ltd 2 What is Ajax? "Asynchronous JavaScript and XML" Originally described in 2005 by Jesse

More information

5. Strict mode use strict ; 6. Statement without semicolon, with semicolon 7. Keywords 8. Variables var keyword and global scope variable 9.

5. Strict mode use strict ; 6. Statement without semicolon, with semicolon 7. Keywords 8. Variables var keyword and global scope variable 9. Javascript 1) Javascript Implementation 1. The Core(ECMAScript) 2. DOM 3. BOM 2) ECMAScript describes 1. Syntax 2. Types 3. Statements 4. Keywords 5. Reserved words 6. Operators 7. Objects 3) DOM 1. Tree

More information

Anexos. Diseño y construcción de un puente grúa automatizado de precisión

Anexos. Diseño y construcción de un puente grúa automatizado de precisión Anexos Diseño y construcción de un puente grúa automatizado de precisión Nombre: Daniel Andrade García Especialidad: Ingeniería Electrónica Industrial y Automática Tutor: Inmaculada Martínez Teixidor Cotutor:

More information

Configuración del laboratorio de acceso telefónico de clientes (San José, Estados Unidos)

Configuración del laboratorio de acceso telefónico de clientes (San José, Estados Unidos) Configuración del laboratorio de acceso telefónico de clientes (San José, Estados Unidos) Contenido Introducción prerrequisitos Requisitos Componentes Utilizados Convenciones Configuración Información

More information

! The final is at 10:30 am, Sat 6/4, in this room. ! Open book, open notes. ! No electronic devices. ! No food. ! Assignment 7 due 10pm tomorrow

! The final is at 10:30 am, Sat 6/4, in this room. ! Open book, open notes. ! No electronic devices. ! No food. ! Assignment 7 due 10pm tomorrow Announcements ECS 89 6/1! The final is at 10:30 am, Sat 6/4, in this room! Open book, open notes! No electronic devices! No food! Assignment 7 due 10pm tomorrow! No late Assignment 7 s! Fill out course

More information

MarkLogic Server. Node.js Application Developer s Guide. MarkLogic 8 February, Copyright 2016 MarkLogic Corporation. All rights reserved.

MarkLogic Server. Node.js Application Developer s Guide. MarkLogic 8 February, Copyright 2016 MarkLogic Corporation. All rights reserved. Node.js Application Developer s Guide 1 MarkLogic 8 February, 2015 Last Revised: 8.0-5, March, 2016 Copyright 2016 MarkLogic Corporation. All rights reserved. Table of Contents Table of Contents Node.js

More information

Querying Microsoft SQL Server 2014

Querying Microsoft SQL Server 2014 Querying Microsoft SQL Server 2014 Duración: 5 Días Código del Curso: M20461 Version: C Método de Impartición: Curso Virtual & Classroom (V&C Select) Temario: This 5-day instructor led course provides

More information

Serverless Single Page Web Apps, Part Four. CSCI 5828: Foundations of Software Engineering Lecture 24 11/10/2016

Serverless Single Page Web Apps, Part Four. CSCI 5828: Foundations of Software Engineering Lecture 24 11/10/2016 Serverless Single Page Web Apps, Part Four CSCI 5828: Foundations of Software Engineering Lecture 24 11/10/2016 1 Goals Cover Chapter 4 of Serverless Single Page Web Apps by Ben Rady Present the issues

More information

Architecture using Functional Programming concepts < + >

Architecture using Functional Programming concepts < + > Architecture using Functional Programming concepts < + > Jorge Castillo @JorgeCastilloPr 1 2 Kotlin and Functional Programming FP means concern separation (declarative computations vs runtime execution),

More information

Intro To Javascript. Intro to Web Development

Intro To Javascript. Intro to Web Development Intro To Javascript Intro to Web Development Preamble I don't like JavaScript But with JS your feelings don't matter. Browsers don't work well with any other language so you have to write code that either:

More information

Lecture 2 Callbacks, Events, and Asynchronous Programming

Lecture 2 Callbacks, Events, and Asynchronous Programming Lecture 2 Callbacks, Events, and Asynchronous Programming 1 / 13 What is asynchronous programming? So far, most (if not all) of the programs you've written are synchronous programs. You write code, and

More information

Scala Actors. Scalable Multithreading on the JVM. Philipp Haller. Ph.D. candidate Programming Methods Lab EPFL, Lausanne, Switzerland

Scala Actors. Scalable Multithreading on the JVM. Philipp Haller. Ph.D. candidate Programming Methods Lab EPFL, Lausanne, Switzerland Scala Actors Scalable Multithreading on the JVM Philipp Haller Ph.D. candidate Programming Methods Lab EPFL, Lausanne, Switzerland The free lunch is over! Software is concurrent Interactive applications

More information

This tutorial is intended to make you comfortable in getting started with the Firebase backend platform and its various functions.

This tutorial is intended to make you comfortable in getting started with the Firebase backend platform and its various functions. Firebase About the Tutorial Firebase is a backend platform for building Web, Android and IOS applications. It offers real time database, different APIs, multiple authentication types and hosting platform.

More information

SAMPLE CHAPTER. Dean Alan Hume. FOREWORD BY Addy Osmani MANNING

SAMPLE CHAPTER. Dean Alan Hume. FOREWORD BY Addy Osmani MANNING SAMPLE CHAPTER Dean Alan Hume FOREWORD BY Addy Osmani MANNING Progressive Web Apps by Dean Alan Hume Chapter 4 Copyright 2018 Manning Publications brief contents PART 1 DEFINING PROGRESSIVE WEB APPS...1

More information

Developer Entrepreneur Crazy person

Developer Entrepreneur Crazy person Jakob Mattsson Developer Entrepreneur Crazy person @jakobmattsson jakob.mattsson@gmail.com on Forgotten funky functions Client-side JavaScript tracking Quick and easy customer feedback. touch-and-tell.se

More information

An Introduction to TypeScript. Personal Info

An Introduction to TypeScript. Personal Info An Introduction to TypeScript Jason Bock Practice Lead Magenic Level: Beginner/Intermediate Personal Info http://www.magenic.com http://www.jasonbock.net https://www.twitter.com/jasonbock https://www.github.com/jasonbock

More information

Index. Ray Nicholus 2016 R. Nicholus, Beyond jquery, DOI /

Index. Ray Nicholus 2016 R. Nicholus, Beyond jquery, DOI / Index A addclass() method, 2 addeventlistener, 154, 156 AJAX communication, 20 asynchronous operations, 110 expected and unexpected responses, 111 HTTP, 110 web sockets, 111 AJAX requests DELETE requests,

More information

this is a cat CS50 Quiz 1 Review

this is a cat CS50 Quiz 1 Review CS50 Quiz 1 Review this is a cat CS50 Quiz 1 Review JavaScript CS50 Quiz 1 Review first, recall from zamyla Remember, PHP is run server-side. The HTML output of this PHP code is sent to the user. Server

More information

FUSE Ajax Tutorial. 07/06 Version 1.2

FUSE Ajax Tutorial. 07/06 Version 1.2 07/06 Version 1.2 This is a tutorial for a real world example of a stock portfolio publisher using Ajax and Apache ActiveMQ (AMQ). This demonstration uses features of Ajax to show multiple interactive

More information

1 CS480W Quiz 6 Solution

1 CS480W Quiz 6 Solution 1 CS480W Quiz 6 Solution Date: Fri Dec 07 2018 Max Points: 15 Important Reminder As per the course Academic Honesty Statement, cheating of any kind will minimally result in receiving an F letter grade

More information

Angular 2 and TypeScript Web Application Development

Angular 2 and TypeScript Web Application Development Angular 2 and TypeScript Web Application Development Course code: IJ -19 Course domain: Software Engineering Number of modules: 1 Duration of the course: 40 study 1 hours Sofia, 2016 Copyright 2003-2016

More information

Detail Json Parse Error - No Json Object Could Be Decoded

Detail Json Parse Error - No Json Object Could Be Decoded Detail Json Parse Error - No Json Object Could Be Decoded message: "JSON parse error - No JSON object could be decoded" type: "error" request_id: chrome.google.com/webstore/detail/advanced-rest-client/.

More information

Lecture 9 (more or less) Web Programming

Lecture 9 (more or less) Web Programming Lecture 9 (more or less) Web Programming DOM: Document Object Model browser presents an object interface accessible from and modifiable by Javascript DOM entities have methods, properties, events element

More information

Building Mobile Apps with the ArcGIS API for JavaScript. Andy Gup, Lloyd Heberlie, Thomas Other

Building Mobile Apps with the ArcGIS API for JavaScript. Andy Gup, Lloyd Heberlie, Thomas Other Building Mobile Apps with the ArcGIS API for JavaScript Andy Gup, Lloyd Heberlie, Thomas Other Agenda Capabilities Managing app life-cycle Working with locally hosted builds Working from JS frameworks

More information

IBM InfoSphere MDM Reference Data Management V10

IBM InfoSphere MDM Reference Data Management V10 IBM InfoSphere MDM Reference Data Management V10 Duración: 3 Días Código del Curso: ZZ670G Método de Impartición: Curso Virtual & Classroom (V&C Select) Temario: This is the Classroom version of Instructor-led

More information

JavaScript Lecture 1

JavaScript Lecture 1 JavaScript Lecture 1 Waterford Institute of Technology May 17, 2016 John Fitzgerald Waterford Institute of Technology, JavaScriptLecture 1 1/31 Javascript Extent of this course A condensed basic JavaScript

More information

Jeff Barczewski. US Air Force Married. Catholic. RGA Father. Consultant Aerospace Engineer. 27 years as professional developer

Jeff Barczewski. US Air Force Married. Catholic. RGA Father. Consultant Aerospace Engineer. 27 years as professional developer Jeff Barczewski Catholic US Air Force Married RGA Father Consultant Aerospace Engineer Elsevier 27 years as professional developer MasterCard (ApplePay / MDES) Founded CodeWinds Training CodeWinds Training

More information

Ajax Ajax Ajax = Asynchronous JavaScript and XML Using a set of methods built in to JavaScript to transfer data between the browser and a server in the background Reduces the amount of data that must be

More information

Pro JavaScript. Development. Coding, Capabilities, and Tooling. Den Odell. Apress"

Pro JavaScript. Development. Coding, Capabilities, and Tooling. Den Odell. Apress Pro JavaScript Development Coding, Capabilities, and Tooling Den Odell Apress" Contents J About the Author About the Technical Reviewers Acknowledgments Introduction xv xvii xix xxi Chapter 1: Object-Oriented

More information

ajax1.html 1/2 lectures/7/src/ ajax1.html 2/2 lectures/7/src/

ajax1.html 1/2 lectures/7/src/ ajax1.html 2/2 lectures/7/src/ ajax1.html 1/2 3: ajax1.html 5: Gets stock quote from quote1.php via Ajax, displaying result with alert(). 6: 7: David J. Malan 8: Dan Armendariz 9: Computer Science E-75 10: Harvard Extension School 11:

More information

Manual De Adobe Photoshop Cs3 En Espanol File Type

Manual De Adobe Photoshop Cs3 En Espanol File Type We have made it easy for you to find a PDF Ebooks without any digging. And by having access to our ebooks online or by storing it on your computer, you have convenient answers with manual de adobe photoshop

More information

2/6/2012. Rich Internet Applications. What is Ajax? Defining AJAX. Asynchronous JavaScript and XML Term coined in 2005 by Jesse James Garrett

2/6/2012. Rich Internet Applications. What is Ajax? Defining AJAX. Asynchronous JavaScript and XML Term coined in 2005 by Jesse James Garrett What is Ajax? Asynchronous JavaScript and XML Term coined in 2005 by Jesse James Garrett http://www.adaptivepath.com/ideas/essays/archives /000385.php Ajax isn t really new, and isn t a single technology

More information

Argon + Web Programing. Hafez Rouzati

Argon + Web Programing. Hafez Rouzati Argon + Web Programing Hafez Rouzati Event Handling overlay HTML

More information

DOC - MANUAL DE ACTIONSCRIPT

DOC - MANUAL DE ACTIONSCRIPT 08 February, 2018 DOC - MANUAL DE ACTIONSCRIPT Document Filetype: PDF 538.42 KB 0 DOC - MANUAL DE ACTIONSCRIPT ActionScript 3.0 para Flash Professional CS5 / ActionScript 3.0 for Flash Professional CS5

More information

Important Change to the Year End W2 Process

Important Change to the Year End W2 Process Important Change to the Year End W2 Process This year you will be able to receive your W-2 electronically, download W-2 data to third party tax filing software, and request a copy of your W-2 tax statement.

More information

CSE 115. Introduction to Computer Science I

CSE 115. Introduction to Computer Science I CSE 115 Introduction to Computer Science I Road map Review JSON Chat App - Part 1 AJAX Chat App - Part 2 Front End JavaScript first Web Page my content

More information

Promises, Promises: Unlocking the Power of jquery s Deferreds

Promises, Promises: Unlocking the Power of jquery s Deferreds Promises, Promises: Unlocking the Power of jquery s Deferreds Brian Klaas Johns Hopkins Bloomberg School of Public Health bklaas@jhsph.edu @brian_klaas Code for today s session: github.com/brianklaas/

More information

LECTURE-3. Exceptions JS Events. CS3101: Programming Languages: Javascript Ramana Isukapalli

LECTURE-3. Exceptions JS Events. CS3101: Programming Languages: Javascript Ramana Isukapalli LECTURE-3 Exceptions JS Events 1 EXCEPTIONS Syntax and usage Similar to Java/C++ exception handling try { // your code here catch (excptn) { // handle error // optional throw 2 EXCEPTIONS EXAMPLE

More information

DECOUPLING PATTERNS, SERVICES AND CREATING AN ENTERPRISE LEVEL EDITORIAL EXPERIENCE

DECOUPLING PATTERNS, SERVICES AND CREATING AN ENTERPRISE LEVEL EDITORIAL EXPERIENCE DECOUPLING PATTERNS, SERVICES AND CREATING AN ENTERPRISE LEVEL EDITORIAL EXPERIENCE Who we are and Why we are here? Saurabh Chugh Started Drupal journey in 2010 with Drupal 6, long journey with Drupal

More information

who "name": "ShihChi Huang", "work": "mobile Netflix", "meta": github/npm/twitter"

who name: ShihChi Huang, work: mobile Netflix, meta: github/npm/twitter RxJS for f2e who { } "name": "ShihChi Huang", "work": "mobile engineer @ Netflix", "meta": "huang47 @ github/npm/twitter" async is hard sync // value is immediately available function getvaluesync(value)

More information

EDITRAN/XAdES. Installation Manual. XAdES Signing and verification. z/os

EDITRAN/XAdES. Installation Manual. XAdES Signing and verification. z/os EDITRAN/XAdES XAdES Signing and verification z/os Installation Manual INDRA April 2018 EDITRAN/XAdES z/os. Installation Manual CONTENTS 1. INTRODUCTION... 1-1 2. INSTALLATION AND REQUIREMENTS... 2-1 2.1.

More information

Building Backbone Plugins

Building Backbone Plugins Building Backbone Plugins Eliminate The Boilerplate In Backbone.js Apps Derick Bailey and Jerome Gravel-Niquet 2013-2014 Muted Solutions, LLC. All Rights Reserved. Backbone.js and the Backbone.js logo

More information

Web Application Security

Web Application Security Web Application Security Rajendra Kachhwaha rajendra1983@gmail.com September 23, 2015 Lecture 13: 1/ 18 Outline Introduction to AJAX: 1 What is AJAX 2 Why & When use AJAX 3 What is an AJAX Web Application

More information

Salesforce CPQ Plugins

Salesforce CPQ Plugins Version 43.0, Summer 18 @salesforcedocs Last updated: June 20, 2018 Copyright 2000 2018 salesforce.com, inc. All rights reserved. Salesforce is a registered trademark of salesforce.com, inc., as are other

More information

Module 5 JavaScript, AJAX, and jquery. Module 5. Module 5 Contains 2 components

Module 5 JavaScript, AJAX, and jquery. Module 5. Module 5 Contains 2 components Module 5 JavaScript, AJAX, and jquery Module 5 Contains 2 components Both the Individual and Group portion are due on Monday October 30 th Start early on this module One of the most time consuming modules

More information

MySQL Document Store and Node.js

MySQL Document Store and Node.js MySQL Document Store and Node.js Johannes Schlüter Rui Quelhas MySQL Clients and Middleware September 2017 Copyright 2017, Oracle and/or its affiliates. All rights reserved. 1 Follow along h ps://ruiquelhas.github.io/percona-live-europe-2017/

More information

Hybrid DOM-Sensitive Change Impact Analysis for JavaScript

Hybrid DOM-Sensitive Change Impact Analysis for JavaScript Hybrid DOM-Sensitive Change Impact Analysis for JavaScript Saba Alimadadi, Ali Mesbah and Karthik Pattabiraman ECOOP 2015 saba@ece.ubc.ca Change Impact Analysis (CIA)! Software must continually change

More information

Ajax Ajax Ajax = Asynchronous JavaScript and XML Using a set of methods built in to JavaScript to transfer data between the browser and a server in the background Reduces the amount of data that must be

More information

20480C: Programming in HTML5 with JavaScript and CSS3. Course Code: 20480C; Duration: 5 days; Instructor-led. JavaScript code.

20480C: Programming in HTML5 with JavaScript and CSS3. Course Code: 20480C; Duration: 5 days; Instructor-led. JavaScript code. 20480C: Programming in HTML5 with JavaScript and CSS3 Course Code: 20480C; Duration: 5 days; Instructor-led WHAT YOU WILL LEARN This course provides an introduction to HTML5, CSS3, and JavaScript. This

More information

Controller/server communication

Controller/server communication Controller/server communication Mendel Rosenblum Controller's role in Model, View, Controller Controller's job to fetch model for the view May have other server communication needs as well (e.g. authentication

More information

Course Outline. ProTech Professional Technical Services, Inc. Comprehensive Angular 7 Course Summary. Description

Course Outline. ProTech Professional Technical Services, Inc. Comprehensive Angular 7 Course Summary. Description Course Summary Description Use Angular 7 to easily build web applications that interacts with the user by dynamically rewriting the current page rather than loading entire new pages from a server. Learn

More information

Manual Of Ios 7 For Ipad Mini Wifi Problemas

Manual Of Ios 7 For Ipad Mini Wifi Problemas Manual Of Ios 7 For Ipad Mini Wifi Problemas ios 8.3 problems are plaguing some iphone and ipad users. related and some of them were carried over from the company's ios 7 and ios 6 updates. ios 8.3 comes

More information

MS_ Advanced Automated Administration With Windows PowerShell.

MS_ Advanced Automated Administration With Windows PowerShell. Advanced Automated Administration With Windows PowerShell www.ked.com.mx Av. Revolución No. 374 Col. San Pedro de los Pinos, C.P. 03800, México, CDMX. Tel/Fax: 52785560 Por favor no imprimas este documento

More information

Async Generators. Composable Async Programming in ES7

Async Generators. Composable Async Programming in ES7 Async Generators Composable Async Programming in ES7 ES6 has Generator Func

More information

RequireJS Javascript Modules for the Browser. By Ben Keith Quoin, Inc.

RequireJS Javascript Modules for the Browser. By Ben Keith Quoin, Inc. RequireJS Javascript Modules for the Browser By Ben Keith Quoin, Inc. Traditional Browser JS One global namespace Often inline JS code embedded directly in HTML Many tags with hidden ordering

More information

Platform. Custom Embedded Tabs. Custom Embedded Tab Definitions. Custom Embedded Tabs, page 1

Platform. Custom Embedded Tabs. Custom Embedded Tab Definitions. Custom Embedded Tabs, page 1 Custom Embedded Tabs, page 1 Custom Embedded Tabs Applies to Cisco Jabber for desktop and mobile clients. Custom embedded tabs display HTML content in the client interface. Learn how to create custom embedded

More information

10.1 Overview of Ajax

10.1 Overview of Ajax 10.1 Overview of Ajax - History - Possibility began with the nonstandard iframe element, which appeared in IE4 and Netscape 4 - An iframe element could be made invisible and could be used to send asynchronous

More information

Contents. Demos folder: Demos\14-Ajax. 1. Overview of Ajax. 2. Using Ajax directly. 3. jquery and Ajax. 4. Consuming RESTful services

Contents. Demos folder: Demos\14-Ajax. 1. Overview of Ajax. 2. Using Ajax directly. 3. jquery and Ajax. 4. Consuming RESTful services Ajax Contents 1. Overview of Ajax 2. Using Ajax directly 3. jquery and Ajax 4. Consuming RESTful services Demos folder: Demos\14-Ajax 2 1. Overview of Ajax What is Ajax? Traditional Web applications Ajax

More information

MANAGING ASYNCHRONY. An Application Perspective

MANAGING ASYNCHRONY. An Application Perspective MANAGING ASYNCHRONY An Application Perspective TYPES OF ASYNCHRONY DETERMINISTIC ORDER. (I/O) NON-DETERMINISTIC ORDER. (USER EVENTS) THESE ARE DIFFERENT. Because both are "events", we reach for the same

More information

Propedéutico de Programación

Propedéutico de Programación Propedéutico de Programación Coordinación de Ciencias Computacionales Semana 6, Primera Parte Dra. Pilar Gómez Gil Versión 1.2 08.07.08 http://ccc.inaoep.mx/~pgomez/cursos/programacion/ Chapter 8 Binary

More information

Introduction to Ajax

Introduction to Ajax Introduction to Ajax with Bob Cozzi What is AJAX? Asynchronous JavaScript and XML A J a X Asynchronous data retrieval using the XMLHttpRequest object from JavaScript Data is retrieved from the server as

More information

WORDPRESS WALKTHROUGH

WORDPRESS WALKTHROUGH WORDPRESS WALKTHROUGH LOGIN To login type in the URL of your site followed by /wp-admin Example: immortagen.com/wp-admin On this page you will then enter in your username and password VISUAL COMPOSER BASICS

More information