Web Architecture. Traditionally client-server but web2.0 is more distributed (cloud) Hypertext Transfer Protocol (HTTP) over TCP/IP.

Slides:



Advertisements
Similar presentations
Chapter 7 JavaScript: Introduction to Scripting. Outline Simple Programs Objects and Variables Obtaining User Input with prompt Dialogs – –Dynamic Welcome.
Advertisements

JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
The Web Warrior Guide to Web Design Technologies
9. AJAX & RIA. 2 Motto: O! call back yesterday, bid time return. — William Shakespeare.
JavaScript (Part 2) CS 183 4/13/2010. JavaScript (Part 2) Will cover: ◦ For.. In ◦ Events ◦ Try.. Catch, Throw ◦ Objects.
AJAX Presented by: Dickson Fu Dimas Ariawan Niels Andreassen Ryan Dial Jordan Nielson CMPUT 410 University of Alberta 2006.
Chapter 16 Dynamic HTML and Animation The Web Warrior Guide to Web Design Technologies.
Javascript Document Object Model. How to use JavaScript  JavaScript can be embedded into your html pages in a couple of ways  in elements in both and.
20-Jun-15 JavaScript and HTML Simple Event Handling.
How the web works: HTTP and CGI explained
Chapter 9 Introduction to the Document Object Model (DOM) JavaScript, Third Edition.
Chapter 14 Introduction to HTML
DHTML. What is DHTML?  DHTML is the combination of several built-in browser features in fourth generation browsers that enable a web page to be more.
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
Introduction to AJAX AJAX Keywords: JavaScript and XML
Ajax (Asynchronous JavaScript and XML). AJAX  Enable asynchronous communication between a web client and a server.  A client is not blocked when an.
Ajax Basics The XMLHttpRequest Object. Ajax is…. Ajax is not…. Ajax is not a programming language. Ajax is not a programming language. Ajax is a methodology.
PHP and AJAX ISYS 475. AJAX Asynchronous JavaScript and XML: – JavaScript, Document Object Model, Cascade Style Sheet, XML, server-side script such as.Net,
Copyright © cs-tutorial.com. Introduction to Web Development In 1990 and 1991,Tim Berners-Lee created the World Wide Web at the European Laboratory for.
JavaScript - Document Object Model. Bhawna Mallick 2 Unit Plan What is DOM and its use? Hierarchy of DOM objects. Reflection of these objects in an HTML.
Scripting Languages.
JavaScript, Fourth Edition Chapter 12 Updating Web Pages with AJAX.
AJAX and Java ISYS 350. AJAX Asynchronous JavaScript and XML: – Related technologies: JavaScript, Document Object Model, XML, server-side script such.
1 HTML References: A HTML Tutorial: /HTMLPrimer.html
Unobtrusive JavaScript
Copyright © 2002 ProsoftTraining. All rights reserved. JavaScript Fundamentals.
DHTML: Dynamic HTML Internet Technology1. What is DHTML? A collection of enhancements to HTML ► To create dynamic and interactive websites Combination.
1 rfXcel Confidential Copyright 2007 Web Technology JavaScript 12/10/07.
1 JavaScript: Objects and Object Models October 25, 2005 Slides modified from Internet & World Wide Web: How to Program (3rd) edition. By Deitel,
Dr. Nuha El-KhaliliInternet Programming ( ) HTML Hyper Text Markup Language The language of web pages Maintained by the W3C
CSE 190: Internet E-Commerce Lecture 5. Exam Material Lectures 1-4 (Presentation Tier) –3-tier architecture –HTML –Style sheets –Javascript –DOM –HTTP.
Ajax. –Asynchronous JavaScript and XML –Umbrella term for technologies that often: Use client-side scripting for layout and formatting Use less than full.
Java Script This is a first JavaScript example. This is a first JavaScript example.
Chapter 8 Cookies And Security JavaScript, Third Edition.
Chapter 16 The World Wide Web Chapter Goals Compare and contrast the Internet and the World Wide Web Describe general Web processing Write basic.
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
J.Holvikivi 1 Ajax & scripts Jaana Holvikivi Metropolia.
Introduction to JavaScript 41 Introduction to Programming the WWW I CMSC Winter 2004 Lecture 17.
Session I Chapter 1 - Introduction to Web Development
Session: 1. © Aptech Ltd. 2Introduction to the Web / Session 1  Explain the evolution of HTML  Explain the page structure used by HTML  List the drawbacks.
Ajax. –Asynchronous JavaScript and XML –Umbrella term for technologies that often: Use client-side scripting for layout and formatting Use less than full.
Asynchronous Javascript And XML AJAX : an introduction UFCEUS-20-2 : Web Programming.
IS-907 Java EE World Wide Web - Overview. World Wide Web - History Tim Berners-Lee, CERN, 1990 Enable researchers to share information: Remote Access.
Web Technologies Lecture 2 HTML and CSS. HTML Hyper Text Markup Language – Describes web documents – Made up of nested HTML markup tags – Tags are the.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
AJAX Asynchronous JavaScript and XML 1. AJAX Outline What is AJAX? Benefits Real world examples How it works 2.
Introduction to HTML. _______________________________________________________________________________________________________________ 2 Outline Key issues.
OBJECTS What is an Object? Definition Properties Methods Events.
AJAX AJAX Asynchronous JavaScript and XML --- MADHAVI
AJAX – Asynchronous JavaScript And XML By Kranthi Kiran Nuthi CIS 764 Kansas State University.
Web Technology (NCS-504) Prepared By Mr. Abhishek Kesharwani Assistant Professor,UCER Naini,Allahabad.
 AJAX technology  Rich User Experience  Characteristics  Real live examples  JavaScript and AJAX  Web application workflow model – synchronous vs.
Java Script This is a first JavaScript example. This is a first JavaScript example.
1 AJAX. AJAX – Whatzit? Asynchronous (content loading)‏ Javascript (logic & control)‏ And XML (request handling)‏
CITA 330 Section 10 Web Remoting Techniques. Web Remoting Web Remoting is a term used to categorize the technique of using JavaScript to directly make.
Open Solutions for a Changing World™ Eddy Kleinjan Copyright 2005, Data Access WordwideNew Techniques for Building Web Applications June 6-9, 2005 Key.
Chapter 4 Java Script – Part2. 2 Location object Properties Properties href – whole path will be displayed. ex: window.location.href ( see example 11)
National College of Science & Information Technology.
Applied Component I Unit II Introduction of java-script
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
AJAX.
Asynchronous Java script And XML Technology
14 A Brief Look at JavaScript and jQuery.
Chapter 27 WWW and HTTP.
HTML5 Level I Session I Chapter 1 - Introduction to Web Development
Chengyu Sun California State University, Los Angeles
AJAX CS-422 Dick Steflik.
Chengyu Sun California State University, Los Angeles
Chengyu Sun California State University, Los Angeles
Presentation transcript:

Web Architecture

Traditionally client-server but web2.0 is more distributed (cloud) Hypertext Transfer Protocol (HTTP) over TCP/IP

How I get my page on a client? 1.Parsing the URL 2.Sending the request 3.  Server responses

status

The response header fields 1.Location: This tells the user agent where the resource it requested can be found. The value is just the URL of the new resource. 2.Server: This tells the user agent which web server is used. Nearly all web servers return this header, although some leave it out. 3.Content-length: This gives the size of the resource, in bytes. 4.Content-type: This describes the file format of the resource. 5.Content-encoding: This means that the resource has been coded in some way and must be decoded before use. 6.Expires: This field can be set for data that are updated at a known time (for instance if they are generated by a script). It is used to prevent browsers from caching the resource beyond the given date. 7.Last-modified: This tells the browser when the resource was last modified. Can be useful for mirroring, update notification etc.

At the client’s browser htmlCSSDOM Java script (AJAX) http Character encoding Fonts, Colors

Cascaded Style Sheets Cascading Style Sheets (CSS) is a style sheet language used for describing the presentation semantics. A style sheet consists of a list of rules. Each rule or rule-set consists of one or more selectors, and a declaration block. A declaration-block consists of a list of declarations in braces. Each declaration itself consists of a property, a colon (:), and a value. If there are multiple declarations in a block, a semi- colon (;) must be inserted to separate each declaration. Selectors are used to declare which part of the markup a style is to be applied See Example

Html code with Java Script This is a first JavaScript example. This is a first JavaScript example.

Document Object Model Hierarchical Objects Window Frame Location History Navigator document image form text XMLHttpRequest ??

Hierarchy Objects ObjectPropertiesMethodsEvent Handlers WindowdefaultStatus frames opener parent scroll self status top window alert blur close confirm focus open prompt clearTimeout setTimeout onLoad onUnload onBlur onFocus FramedefaultStatus frames opener parent scroll self status top window alert blur close confirm focus open prompt clearTimeout setTimeout none (The onLoad and onUnload event handlers belong to the Window object) Locationhash host hostname href pathname por protocol search reload replace none

Historylength forward go backnone NavigatorappCodeName appName appVersion mimeTypes plugins userAgent javaEnablednone documentalinkColor anchors applets area bgColor cookie fgColor forms images lastModified linkColor links location referrer title vlinkColor clear close open write writeln none (the onLoad and onUnload event handlers belong to the Window object.

imageborder complete height hspace lowsrc name src vspace width none formaction elements encoding FileUpload method name target submit reset onSubmit onReset textdefaultValue name type value focus blur select onBlur onCharge onFocus onSelect

Built-in Objects Array Data String

Built-in Objects ObjectPropertiesMethodsEvent Handlers Arraylengthjoin reverse sort xx none DatenonegetDate getDay getHours getMinutes getMonth getSeconds getTime getTimeZoneoffset getYear parse prototype setDate setHours setMinutes setMonth setSeconds setTime setYear toGMTString toLocaleString UTC none

Stringlength prototype anchor big blink bold charAt fixed fontColor fontSize indexOf italics lastIndexOf link small split strike sub substring sup toLowerCase toUpperCase Window

XMLHttpRequest Object Properties for Mozilla, Firefox, Netscape, Chrome PropertyDescription channelContains the channel used to perform the request. Read-only. readyStateContains the state of the request. Read- only. responseTextContains the response body as a string. Read-only. responseXMLContains the response body as XML. Read-only. statusContains the HTTP status code returned by a request. Read-only. statusTextContains the HTTP response status text. Read-only.

XMLHttpRequest Object Methods for Mozilla, Firefox, Netscape, Chrome Method overrideMimeType Description abort Aborts the HTTP request. getAllResponseHeaders Returns all the HTTP headers. getResponseHeader Returns the value of an HTTP header. openRequest Open / send / setRequestHeader Native (nonscript) method to open a request. OverrideMimeTypeOverrides the MIME type the server returns.

Ready state property

Opening XMLRequest Object open("method", "URL"[, asyncFlag[, "userName"[, "password"]]]) XMLHttpRequestObject.open(“GET”, datasource);

A in ajax stands for asynchronous handshaking function getData(dataSource, divID) { if(XMLHttpRequestObject) { XMLHttpRequestObject.open("GET", dataSource); XMLHttpRequestObject.onreadystatechange = callback() } function callback() {. }

Shortcut for callback() function getData(dataSource, divID) { if(XMLHttpRequestObject) { XMLHttpRequestObject.open("GET", dataSource); XMLHttpRequestObject.onreadystatechange = function() {. }

ajax

–Asynchronous JavaScript and XML –Umbrella term for technologies that often: Use client-side scripting for layout and formatting Use less than full page reloads to change content Use data formats other than HTML Interact asynchronously with the server –Not necessarily JavaScript or XML, but we’ll use the term for convenience

MySpaceTraffic Request: GET &MyToken=fcf392cd-2a35-4cc2-86fa-cb24b7a330dd HTTP/1.0 Response: randomseed= Date.parse(newDate()); …. …

Google Maps Traffic Request: GET &z=19&t=k&vp= , &ev=ziHTTP/1.0 Response: GAddCopyright("k","483", , , , ,12,""); GAddCopyright("k","484", , , , ,12,"");

Ajax in 5 steps

ajax History Before there was browser support for asynchronous calls: –There were hidden IFramestraditionally used to dynamically IFrameset to 0px, invisible to the user Used to GET/POST form fields to the server Example: <IFRAME style="DISPLAY: none; LEFT: 0px; POSITION: absolute; TOP: 0px" src=" frameBorder="0“ scrolling="no">

Real ajax Started with… – XMLHttpRequestObject (often called XHR) In Internet Explorer, XMLHttpobject, part of MSXML –ActiveX object, vsnative object in Firefox –Will be implemented as a native object in IE 71 Instantiation: if (window.XMLHttpRequest){ // If IE7, Mozilla, Safari, etc: Use native object varxmlHttp= new XMLHttpRequest() } else { if (window.ActiveXObject){ //...otherwise, use the ActiveX control for IE5.x and IE6 varxmlHttp= new ActiveXObject("Microsoft.XMLHTTP"); }}

XMLHttpRequest (XHR) is a DOM API that can be used inside a web browser scripting language, such as JavaScript, to send an HTTP or an HTTPS request directly to a web server and load the server response data directly back into the scripting language. Once the data is within the scripting language, it is available as both an XML document, if the response was valid XML markup, and as plain text.

Example AJAX request xmlHttp= new XMLHttpRequest(); xmlHttp.open("GET", “ xmlHttp.onreadystatechange= updatePage; xmlHttp.send(null); Example AJAX response handling function updatePage() { if (xmlHttp.readyState== 4) { if (request.status== 200) { varresponse = xmlHttp.responseText; }

Downstream Options The real beauty of XHR –Arbitrary structure of content Not restricted like HTML Forms –Asynchronous Communication, including callbacks XHR can handle many types of downstream (from server) data –XML –Full JavaScript –JavaScript Arrays –JSON –Custom Serialization Frameworks Atlas Google Web Toolkit

The Document Object Model (DOM) is a cross-platform and language-independent convention for representing and interacting withobjects in HTML, XHTML and XML docum ents. Aspects of the DOM (such as its "Elements") may be addressed and manipulated within the syntax of the programming language in usecross-platformlanguageobjectsHTMLXHTMLXML