Introduction to AJAX and the migration toward applications

Slides:



Advertisements
Similar presentations
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 16 Introduction to Ajax.
Advertisements

By Loukik Purohit & Rohit Ghatol
AJAX Presented by: Dickson Fu Dimas Ariawan Niels Andreassen Ryan Dial Jordan Nielson CMPUT 410 University of Alberta 2006.
WHAT IS AJAX? Zack Sheppard [zts2101] WHIM April 19, 2011.
Cloud Computing Lecture #7 Introduction to Ajax Jimmy Lin The iSchool University of Maryland Wednesday, October 15, 2008 This work is licensed under a.
Ajax (Asynchronous JavaScript and XML). AJAX  Enable asynchronous communication between a web client and a server.  A client is not blocked when an.
JavaScript & jQuery the missing manual Chapter 11
Lecture 12 – AJAX SFDV3011 – Advanced Web Development Reference: 1.
AJAX Without the “J” George Lawniczak. What is Ajax?
JavaScript is a client-side scripting language. Programs run in the web browser on the client's computer. (PHP, in contrast, is a server-side scripting.
Web Application with AJAX CS 526 advanced interned and Web system Presenters Faris Kateb Mohammed AbdulAziz Omar Alzahrani.
06/10/2015AJAX 1. 2 Introduction All material from AJAX – what is it? Traditional web pages and operation Examples of AJAX use Creating.
HTML5 Communication. The Setup Somewhere on the web, a server makes a ”service” available, that we wish to use in a web application The service may offer.
The Document Object Model. The Web B.D, A.D. They aren’t web pages, they’re document objects A web browser interprets structured information. A server.
Weekend MS CS Program Internet and Web Technologies COT 5930 Web Project Development - Ajax Dr. Roy Levow, Associate Chair & Professor
Understanding AJAX Hype, Hope, Hurt and Help for the Web MJTS May 4th, 2006 _________________________ Terence Conklin, Conklin Systems
Cross Site Integration “mashups” cross site scripting.
Lecture 9: AJAX, Javascript review..  AJAX  Synchronous vs. asynchronous browsing.  Refreshing only “part of a page” from a URL.  Frameworks: Prototype,
Web Technology Introduction AJAXAJAX. AJAX Outline  What is AJAX?  Benefits  Real world examples  How it works  Code review  Samples.
Web Application with AJAX CS 526 advanced interned and Web system Presenters Faris Kateb Mohammed AbdulAziz Omar Alzahrani.
Ajax for Dynamic Web Development Gregory McChesney.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
 AJAX – Asynchronous JavaScript and XML  Ajax is used to develop fast dynamic web applications  Allows web pages to be updated asynchronously by transferring.
AJAX James Kahng. Congrats Jack Guo for Angular entryentry This week’s coding challenge at end of talk.
AJAX Asynchronous JavaScript and XML 1. AJAX Outline What is AJAX? Benefits Real world examples How it works 2.
JSON – Java Script Object Notation. What is JSON JSON is a data interchange format Interactive Web 2.0 applications, no more use page replacement. Data.
SE-2840 Dr. Mark L. Hornick 1 Introduction to Ajax Asynchronous Javascript And XML.
Introduction to AJAX MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/4/2016.
Web Application with AJAX CS 526 advanced interned and Web system Presenters Faris Kateb Mohammed AbdulAziz Omar Alzahrani.
NCCUCS 軟體工程概論 Lecture 5: Ajax, Mashups April 29, 2014.
CAESked Computer Aided Engineering Scheduler. Introduction Team Members: Chris Fruin & Jerry Grochowski What CAESked is: Web based class scheduling application.
JQuery, JSON, AJAX. AJAX: Async JavaScript & XML In traditional Web coding, to get information from a database or a file on the server –make an HTML form.
Web Technologies Computing Science Thompson Rivers University
Web API - Introduction AJAX, Spring Data REST SoftUni Team Web API
Not a Language but a series of techniques
Working with Client-Side Scripting
AJAX – Asynchronous JavaScript and XML
Application with Cross-Platform GUI
Asynchronous Java script And XML Technology
AJAX.
* Lecture 26 Manifest Asynchrony
Server Side Programming Overview And file system basics
Introduction to Databases with MAMP/LAMP/WAMP thrown in!
CSU CT 310, Web Development ©Ross Beveridge
CT Web Development, Colorado State University
* Lecture 12 Mapping, Map Reduction Summing integers,
HTML5 Drawing Canvas and Video
Handling Files In particular, uploading files.
Tables from Arrays of Objects Exploding Strings
Content Management and WordPress
HTML Basics & Context & IDEs & Server Basics & Online Notes
AJAX Robin Burke ECT 360.
* Lecture 22 Images * Course logo spider web photograph from Morguefile openstock photograph by Gabor Karpati, Hungary.
MySQL Tables and Relations 101
* Lecture 5 PHP Basics * Course logo spider web photograph from Morguefile openstock photograph by Gabor Karpati, Hungary.
Querying Client Information Forms and Passing Data,
* jQuery * Course logo spider web photograph from Morguefile openstock photograph by Gabor Karpati, Hungary.
COP 3813 Intro to Internet Computing
Authentication Stepped Up Persistent User Data Protected Content.
HTML5 AJAX & JSON APIs
MIS JavaScript and API Workshop (Part 3)
Introduction to AJAX and JSON
Chengyu Sun California State University, Los Angeles
HTML Basics & Context & IDEs & Server Basics & Online Notes
Loops and Conditionals Generating , Reading files.
Web Technologies Computing Science Thompson Rivers University
Introduction to AJAX and JSON
Ajax and JSON Jeremy Shafer Department of MIS Fox School of Business
Ajax and JSON Jeremy Shafer Department of MIS Fox School of Business
Alternatives to our approach
Presentation transcript:

Introduction to AJAX and the migration toward applications * Lecture 24 Introduction to AJAX and the migration toward applications * Course logo spider web photograph from Morguefile openstock photograph by Gabor Karpati, Hungary.

AJAX – Breaking the Promise Before AJAX A server serves a page to a client! After AJAX Widget level event driven programming. Server analogous to App backend. Client analogous to interactive GUI. AJAX once meant … Asynchronous JavaScript and XML The XML part has faded away. 11/22/2018 CSU CT 310, Web Development, ©Ross Beveridge

CSU CT 310, Web Development, ©Ross Beveridge Outward Examples Google Apps MapQuest Facebook Really, almost all modern complex sites. An early example of Google Docs Example from wikipedia 11/22/2018 CSU CT 310, Web Development, ©Ross Beveridge

Support Libraries Abound 11/22/2018 CSU CT 310, Web Development, ©Ross Beveridge

CSU CT 310 Web Development ©Ross Beveridge & Jamie Ruiz And One is now Dominant Yes, we are getting closer, but first … 11/22/2018 CSU CT 310 Web Development ©Ross Beveridge & Jamie Ruiz

CSU CT 310, Web Development, ©Ross Beveridge 11/22/2018 CSU CT 310, Web Development, ©Ross Beveridge

CSU CT 310, Web Development, ©Ross Beveridge 11/22/2018 CSU CT 310, Web Development, ©Ross Beveridge

CSU CT 310, Web Development, ©Ross Beveridge JavaScript as a link 11/22/2018 CSU CT 310, Web Development, ©Ross Beveridge

Basic JavaScript Review The div has a name (id actually) The document is an object/element Document contains other elements Elements have ‘innerHTML’ Not ‘inner peace’ When/where does the html get set? 11/22/2018 CSU CT 310, Web Development, ©Ross Beveridge

Example 2 -XMLHttpRequest Important New Object! Note example does not support antiquated IE6 ActiveX alternative. 11/22/2018 CSU CT 310, Web Development, ©Ross Beveridge

CSU CT 310, Web Development, ©Ross Beveridge Example 2 – in action 11/22/2018 CSU CT 310, Web Development, ©Ross Beveridge

CSU CT 310, Web Development, ©Ross Beveridge Example 2 - Comments There is a var/object ‘http’ Establishes a connection to a server. Notice the use of Open ‘Get’ Events Send null - close 11/22/2018 CSU CT 310, Web Development, ©Ross Beveridge

CSU CT 310, Web Development, ©Ross Beveridge readyState Change 11/22/2018 CSU CT 310, Web Development, ©Ross Beveridge

CSU CT 310, Web Development, ©Ross Beveridge Example 3 code 11/22/2018 CSU CT 310, Web Development, ©Ross Beveridge

CSU CT 310, Web Development, ©Ross Beveridge Example 3 in action 11/22/2018 CSU CT 310, Web Development, ©Ross Beveridge

CSU CT 310, Web Development, ©Ross Beveridge Example 4 – Code 1 11/22/2018 CSU CT 310, Web Development, ©Ross Beveridge

CSU CT 310, Web Development, ©Ross Beveridge ct310lec25validate.php 11/22/2018 CSU CT 310, Web Development, ©Ross Beveridge

CSU CT 310, Web Development, ©Ross Beveridge Example 4 in action Pay attention to character feedback 11/22/2018 CSU CT 310, Web Development, ©Ross Beveridge

CSU CT 310, Web Development, ©Ross Beveridge Cross-Site Scripting! In class (2012) I walked head long into an illegal use of cross-site scripting. On my laptop, i.e. localhost, I tried: http.open("GET", 'http:///www.cs.colostate.edu/' + '~ct310/yr2013sp/aplay/lec18/' + 'validate.php?name=' + user, true); Violates the “Same Origin Policy” ! 11/22/2018 CSU CT 310, Web Development, ©Ross Beveridge

CSU CT 310, Web Development, ©Ross Beveridge Background & Summary Cross-site scripting attacks represent a large fraction of malicious behavior – stolen data/accounts/etc. In a nutshell, site A gets hacked, hook inserted to load JavaScript from site B, code from B then gains access to what A knows/does etc. 11/22/2018 CSU CT 310, Web Development, ©Ross Beveridge

CSU CT 310, Web Development, ©Ross Beveridge Same Origin Policy Modern browsers impose strong constraints on AJAX behavior. Domain serving document must be the same domain used through XMLHttpRequest(). Workarounds include JSONP, Cross-origin resource sharing. 11/22/2018 CSU CT 310, Web Development, ©Ross Beveridge

CSU CT 310 Web Development ©Ross Beveridge & Jamie Ruiz Example 5: Post Not Get Same as Example 4 but using POST. Bit more code; bit more secure. 11/22/2018 CSU CT 310 Web Development ©Ross Beveridge & Jamie Ruiz

CSU CT 310, Web Development, ©Ross Beveridge Moving Data - JSON Moving data from server to client? We’ve just seen plain text JSON is common for structured data 11/22/2018 CSU CT 310, Web Development, ©Ross Beveridge

Example 6 – JSON Dogs json_encode($dogs) JSON.parse(http.responseText) 11/22/2018 CSU CT 310, Web Development, ©Ross Beveridge

Closing thoughts on AJAX The Path Back to Computer Science In the beginning HTML is simple and elegant … Easy to learn and use Far removed from CS complexities With AJAX, the circle closes What do you need to understand? Just about everything taught in CS 11/22/2018 CSU CT 310, Web Development, ©Ross Beveridge