The Web: Concepts and Technology

Size: px
Start display at page:

Download "The Web: Concepts and Technology"

Transcription

1 The Web: Concepts and Technology Web Services Feb 10 1 Eugene Agichtein CS 190: The Web: Concepts and Technology, Emory University Spring 2009

2 Today s Plan Javascript wrap-up: p Objects Functions Loops Events WbS Web Services XML 2 Eugene Agichtein CS 190: The Web: Concepts and Technology, Emory University Spring 2009

3 Debugging JavaScript 1. Debugging JS is a pain I know of two reasonable tools for JS debuggin: Firebug: VenkMan: / f / /216 3 Eugene Agichtein CS 190: The Web: Concepts and Technology, Emory University Spring 2009

4 JS Types Numbers Operators: +, -, *, and / as the basic four arithmetic operations. Comparison: <, >, <=, >= %, is the remainder operator: if you divide one number by another, this operator gives you the remainder. For example, 7 % 3 is 1. Strings : pieces of text or sequences of characters. E.g., "Frodo", "The Lord of the Rings", and "this is a string" are all strings. Strings can be created with double quote character (") or the single quote character ('). The only operator for strings is the concatenation operator, written +,which glues two strings together. E.g. "rail" + "road" is "railroad". Booleans logical values that are either true or false. E.g., the expression (7 > 13) is false while the expression (7 > 3) is true. logic operators for boolean values:! means not, so!(7 > 13) is true && means and, so (7 > 13) && (7 > 3) is false means or, so (7 > 13) (7 > 3) is true 4 Eugene Agichtein CS 190: The Web: Concepts and Technology, Emory University Spring 2009

5 Summary three basic data types: strings, numbers, and booleans. The basic arithmetic operators + (addition), - (subtraction), * (multiplication), / (division), and % (remainder) are provided for numbers. variables can be assigned values of any type, including numbers and numeric expressions. When an assignment statement is executed, the expression on the right-hand side is evaluated first, and then the resulting value is assigned to the variable on the left-hand side. multiplication and division have higher precedence than addition and subtraction. Among operators with the same precedence, expressions are evaluated in a left-to-right order. When the + operator is applied to a string and a number, the number is automatically converted into a string and then the two are concatenated. The prompt() method always a returns a string value, even en when a number is entered by the user. A string can be converted to number using parsefloat() for parseint function. variables can be used to store input values, define easily modifiable values, and retain intermediate values in complex computations. 5 Eugene Agichtein CS 190: The Web: Concepts and Technology, Emory University Spring 2009

6 User-defined functions <HEAD> <TITLE> The function template</title> <SCRIPT TYPE = "text/javascript"> "> functionname() { }... JavaScript code to define the function goes here... </SCRIPT> </HEAD> 6 Eugene Agichtein CS 190: The Web: Concepts and Technology, Emory University Spring 2009

7 Function Declaration vs. Invocation <HTML><HEAD> <META http-equiv=content-type content="text/html; charset=windows-1252"> <SCRIPT language="javascript 2.1" type=text/javascript> function main() { window.alert("hello World!"); } </SCRIPT> </HEAD> <BODY onload=javascript:main();> <H1 style="text- ALIGN: center">hello World</H1> <HR width="85%" SIZE=2> </BODY> </HTML> 7

8 Example: Date Generation Suppose want to date document (e.g., like newspapers do) <script type = "text/javascript"> var today = new Date(); //Date object var the_day = today.getdate(); //Method invocation var the_month = today.getmonth(); //Method invocation var the_year = today.getfullyear(); the_month = the_month + 1; //month starts at zero var the_whole_date date= the_month +"/"+the the_day +"/"+the the_year; document.write( In CS190, today is " + the_whole_date + "<p>"); </script> 8 Eugene Agichtein CS 190: The Web: Concepts and Technology, Emory University Spring 2009

9 Function Summary Functions encapsulate code for performing common tasks that we're likely to repeat in many contexts. Function definitions are generally within the HEAD of a document. Function calls are generally within the BODY of a document. Once a function is defined, you can call it as often as you like. A function definition is only that a definition. Unless a function is called, it will not execute! You call a function with no parameters like this: wisdom(); A parameter allows something about the function to change from one invocation to the next. To call a function with a parameter you include a value (or expression that evaluates to a value) within the parantheses. Your function call must be within <SCRIPT> tags or an event handler. 9 Eugene Agichtein CS 190: The Web: Concepts and Technology, Emory University Spring 2009

10 More about Objects JavaScript String object var txt="hello world!"; document.write(txt.touppercase()); Complete String reference: 10 Eugene Agichtein CS 190: The Web: Concepts and Technology, Emory University Spring 2009

11 A little more about forms Select Lists <select name="beverage"> <option>coke <option>pepsi <option>beer <option>wine </select> What if we wanted to update the list of options dynamically: Courses to drop/add; available shoe sizes for this model, 11 Eugene Agichtein CS 190: The Web: Concepts and Technology, Emory University Spring 2009

12 Loops <script type="text/javascript"> for (i =0;i <=100; i++){ document.write(i+ I will never cross on red again <p> ); } </script> Equivalent: i=0; while (i<=100) { document.write("the number is " + i); } Useful play tool: p yj 12 Eugene Agichtein CS 190: The Web: Concepts and Technology, Emory University Spring 2009

13 JavaScript Arrays The Array object is used to store multiple values in a single variable. Complete Reference: var mycars=new Array(); mycars[0]="saab"; mycars[1]="volvo"; mycars[2]="bmw"; Access to Array elements: document.write(mycars[0]); mycars[0]="opel"; 13 Eugene Agichtein CS 190: The Web: Concepts and Technology, Emory University Spring 2009

14 Arrays + Loops = Goodness <script type="text/javascript"> var mycars=new Array( Saab, Volvo, BMW ); for (i = 0; i <mycars.length; C l i++){ document.write(mycars[i]+ <br> ); } </script> 14 Eugene Agichtein CS 190: The Web: Concepts and Technology, Emory University Spring 2009

15 Events There are common JavaScript events defined on most HTML page elements. You can write JavaScript code that runs if and when one of these events takes place. Example: JavaScript code whose execution is triggered by an event is called an event handler. Important events: onload and onsubmit Other common JavaScript Events: 15 Eugene Agichtein CS 190: The Web: Concepts and Technology, Emory University Spring 2009

16 JavaScript: Processing Form Data Form validation is the process of checking that the information provided by the user is correct (or not obviously incorrect) before processing it. <form action= onsubmit="return validate(this);" > <label for="q">search:</label> <input type="text" name="q" id="q"> </form> function validate(f) { if(f.q.value=="") { return false; } else{ return true; } } 16 Eugene Agichtein CS 190: The Web: Concepts and Technology, Emory University Spring 2009

17 Web 2.0 Event-driven programming model that involves calling web service APIs by sending and receiving messages in XML format over the HTTP protocol. Today we ll just cover the basics to give you background after that t you should be able to follow/modify examples in the (many) online tutorials to do what you need 17

18 Intuition Web service API: collection of function definitions Web service API call: invocation of a Web Service function Example: Yahoo Search API Definition: Invocation: 18 Eugene Agichtein CS 190: The Web: Concepts and Technology, Emory University Spring 2009

19 What is a web service? A software system designed to support interoperable machine-to-machine interaction over a network. It has an interface described in a machine-processable format. -W3C WSDL and SOAP conveyed using HTTP with an XML serialization + other Webrelated standards Example Web services: Amazon ( Yahoo ( ebay y( ( p Flickr ( YouTube ( Del.icio.us ( 19

20 Web Service models Resource oriented model A resource is anything that can have an identifier (URI) Focuses on resource description and representation (data object reflecting state of resource) Service oriented model A service is realised by an agent (provider) and used by another (requester) Focuses on tasks (unit of action) that may be performed by an agent: description, messaging/choreography and goal state Message oriented model A message is the basic unit of data sent from one agent to another: the action taken in response to receiving a message is up to the recipient Focuses on message structure (contract) and transport (choice of protocol carries no semantics) 20

21 AJAX (Asynchronous Javascript + XML) Uses browser s XML support: DOM, XSLT XMLHttpRequest Google Maps is best-known AJAX application 21

22 AJAX Design Principles 1. The browser hosts an application, not content Application code delivered d to browser, mostly as JavaScript code 2. The server delivers data, not content Data may be plain text, JavaScript fragments, or XML documents 3. User/application interaction is continuous and fluid UI metaphors like drag-and-drop become possible 4.This is real coding and requires discipline Significant developer responsibility to manage conversational state over entire web transaction 22

23 Basic AJAX process 23

24 The src Attribute We can link external JavaScript applications using the src attribute: <script type="text/javascript" language="javascript 2.1" src="scripts/hithere.js"> 24

25 Simple Data Exchange Format: JSON JSON (JavaScript Object j Notation,, RFC-4627) Subset of JS object literal notation (does not require JS) Data types: number, string, boolean, array, object, null Supported by many languages In Dec 2005, Yahoo! added support for JSON but No schema mechanism (validation, code generation) Limited type system (no date or time) No extension or versioning 25

26 Data Interchange The key idea in Ajax. An alternative to page replacement. Applications delivered as pages. How should the data be delivered? 26

27 JSON JavaScript Object Notation Minimal Textual Subset of JavaScript 27

28 Values Strings Numbers Booleans Objects Arrays null 28

29 Object Objects are unordered containers of key/value pairs Objects are wrapped in { }, separates key/value pairs : separates keys and values Keys are strings Values are JSON values struct, record, hashtable, object 29

30 Object 30

31 Object { 31 } "name": "Jack B. Nimble", "at large": true, "grade": "A", "format": { "type": "rect", "width": 1920, "height": 1080, "interlace": false, "framerate": 24 }

32 Array Arrays are ordered sequences of values Arrays are wrapped in [], separates values JSON does not talk about indexing. An implementation can start array indexing at 0 or 1. 32

33 Array ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] [ ] [0, -1, 0], [1, 0, 0], [0, 0, 1] 33

34 Arrays vs Objects Use objects when the key names are arbitrary strings. Use arrays when the key names are sequential integers. Don't get confused by the term Associative Array. 34

35 JSON in Ajax HTML Delivery. JSON data is built into the page. <html>... <script> var data = {... JSONdata... }; 35

36 JSON in Ajax XMLHttpRequest Obtain responsetext Parse the responsetext responsedata = eval( '(' + responsetext + ')'); responsedata = responsetext.parsejson(); 36

37 JSON in Ajax Secret <iframe> Request data using form.submit to the <iframe> target. The server sends the JSON text embedded in a script in a document. <html><head><script> document.domain = 'penzance.com'; parent.deliver({... JSONtext... }); </script></head></html> The function deliver is passed the value. 37

38 JSON in Ajax Dynamic script tag hack. Create a script node. The src url makes the request. The server sends the JSON text embedded in a script. deliver({... JSONtext... }); The function deliver is passed the value. The dynamic script tag hack is insecure. 38

39 JSONRequest A new facility. Two way data interchange between any page and any server. Exempt from the Same Origin Policy. Campaign to make a standard feature of all browsers. 39

40 JSON Looks Like Data JSON's simple values are the same as used in programming languages. No restructuring is required: JSON's structures look like conventional programming language structures. JSON's object is record, struct, object, dictionary, hash, associate array... JSON's array is array, vector, sequence, list... 40

41 Yahoo Web Service with JSON Tutorial/Howto: Can use nice interface widgets:

42 JSON Example By default the Yahoo! Web Services return output in XML format. To get output in JSON format, use the output=json parameter in the request: h?appid=yahoodemo&query=madonna&output=json Key idea: Callback function. The callback parameter (callback=function) wraps the JSON output text in parentheses and a function name (e.g., MyFunction) com/imagesearchservice/v1/imagesea rch?appid=yahoodemo&query=madonna&output=json&callback =MyFunction 42 Eugene Agichtein CS 190: The Web: Concepts and Technology, Emory University Spring 2009

43 Complete Example <html> <head> <title>how Many Pictures Of Madonna Do We Have?</title> </head> <body> <script type="text/javascript"> function myfunction(obj) { alert(obj.resultset.totalresultsavailable); } </script> <script type="text/javascript" src=" pid=yahoodemo&query=madonna&output=json&callback=myfunction"> </script> </body> </html> 43 Eugene Agichtein CS 190: The Web: Concepts and Technology, Emory University Spring 2009

44 Can we do something more interesting? ti Display first 10 images of results for(i=0; i<obj.resultset.totalresultsavailable && i<10; i++){ var img = obj.array[i]; //do something with the image, like write to document! } 44 Eugene Agichtein CS 190: The Web: Concepts and Technology, Emory University Spring 2009

AJAX: From the Client-side with JavaScript, Back to the Server

AJAX: From the Client-side with JavaScript, Back to the Server AJAX: From the Client-side with JavaScript, Back to the Server Asynchronous server calls and related technologies CS 370 SE Practicum, Cengiz Günay (Some slides courtesy of Eugene Agichtein and the Internets)

More information

Working with Database. Client-server sides AJAX JSON Data formats Working with JSON data Request Response Bytes Database

Working with Database. Client-server sides AJAX JSON Data formats Working with JSON data Request Response Bytes Database Working with Database Client-server sides AJAX JSON Data formats Working with JSON data Request Response Bytes Database Web programming Basic Web Programming: HTML CSS JavaScript For more Dynamic Web Programming:

More information

REST. Web-based APIs

REST. Web-based APIs REST Web-based APIs REST Representational State Transfer Style of web software architecture that simplifies application Not a standard, but a design pattern REST Take all resources for web application

More information

Session 16. JavaScript Part 1. Reading

Session 16. JavaScript Part 1. Reading Session 16 JavaScript Part 1 1 Reading Reading Wikipedia en.wikipedia.org/wiki/javascript / p W3C www.w3.org/tr/rec-html40/interact/scripts.html Web Developers Notes www.webdevelopersnotes.com/tutorials/javascript/

More information

Data Formats and APIs

Data Formats and APIs Data Formats and APIs Mike Carey mjcarey@ics.uci.edu 0 Announcements Keep watching the course wiki page (especially its attachments): https://grape.ics.uci.edu/wiki/asterix/wiki/stats170ab-2018 Ditto for

More information

CSC 337. JavaScript Object Notation (JSON) Rick Mercer

CSC 337. JavaScript Object Notation (JSON) Rick Mercer CSC 337 JavaScript Object Notation (JSON) Rick Mercer Why JSON over XML? JSON was built to know JS JSON JavaScript Object Notation Data-interchange format Lightweight Replacement for XML It's just a string

More information

CSC Web Programming. Introduction to JavaScript

CSC Web Programming. Introduction to JavaScript CSC 242 - Web Programming Introduction to JavaScript JavaScript JavaScript is a client-side scripting language the code is executed by the web browser JavaScript is an embedded language it relies on its

More information

Session 6. JavaScript Part 1. Reading

Session 6. JavaScript Part 1. Reading Session 6 JavaScript Part 1 Reading Reading Wikipedia en.wikipedia.org/wiki/javascript Web Developers Notes www.webdevelopersnotes.com/tutorials/javascript/ JavaScript Debugging www.w3schools.com/js/js_debugging.asp

More information

JavaScript s role on the Web

JavaScript s role on the Web Chris Panayiotou JavaScript s role on the Web JavaScript Programming Language Developed by Netscape for use in Navigator Web Browsers Purpose make web pages (documents) more dynamic and interactive Change

More information

COMS W3101: SCRIPTING LANGUAGES: JAVASCRIPT (FALL 2017)

COMS W3101: SCRIPTING LANGUAGES: JAVASCRIPT (FALL 2017) COMS W3101: SCRIPTING LANGUAGES: JAVASCRIPT (FALL 2017) RAMANA ISUKAPALLI RAMANA@CS.COLUMBIA.EDU 1 LECTURE-1 Course overview See http://www.cs.columbia.edu/~ramana Overview of HTML Formatting, headings,

More information

JavaScript CS 4640 Programming Languages for Web Applications

JavaScript CS 4640 Programming Languages for Web Applications JavaScript CS 4640 Programming Languages for Web Applications 1 How HTML, CSS, and JS Fit Together {css} javascript() Content layer The HTML gives the page structure and adds semantics Presentation

More information

A.A. 2008/09. Why introduce JavaScript. G. Cecchetti Internet Software Technologies

A.A. 2008/09. Why introduce JavaScript. G. Cecchetti Internet Software Technologies Internet t Software Technologies JavaScript part one IMCNE A.A. 2008/09 Gabriele Cecchetti Why introduce JavaScript To add dynamicity and interactivity to HTML pages 2 What s a script It s a little interpreted

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

JavaScript CS 4640 Programming Languages for Web Applications

JavaScript CS 4640 Programming Languages for Web Applications JavaScript CS 4640 Programming Languages for Web Applications 1 How HTML, CSS, and JS Fit Together {css} javascript() Content layer The HTML gives the page structure and adds semantics Presentation

More information

User Interaction: jquery

User Interaction: jquery User Interaction: jquery Assoc. Professor Donald J. Patterson INF 133 Fall 2012 1 jquery A JavaScript Library Cross-browser Free (beer & speech) It supports manipulating HTML elements (DOM) animations

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

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

CSC Web Technologies, Spring Web Data Exchange Formats

CSC Web Technologies, Spring Web Data Exchange Formats CSC 342 - Web Technologies, Spring 2017 Web Data Exchange Formats Web Data Exchange Data exchange is the process of transforming structured data from one format to another to facilitate data sharing between

More information

Welcome to CS50 section! This is Week 10 :(

Welcome to CS50 section! This is Week 10 :( Welcome to CS50 section! This is Week 10 :( This is our last section! Final project dates Official proposals: due this Friday at noon Status report: due Monday, Nov 28 at noon Hackathon: Thursday, Dec

More information

CS Final Exam Review Suggestions - Spring 2018

CS Final Exam Review Suggestions - Spring 2018 CS 328 - Final Exam Review Suggestions p. 1 CS 328 - Final Exam Review Suggestions - Spring 2018 last modified: 2018-05-03 Based on suggestions from Prof. Deb Pires from UCLA: Because of the research-supported

More information

Some Facts Web 2.0/Ajax Security

Some Facts Web 2.0/Ajax Security /publications/notes_and_slides Some Facts Web 2.0/Ajax Security Allen I. Holub Holub Associates allen@holub.com Hackers attack bugs. The more complex the system, the more bugs it will have. The entire

More information

JSON is a light-weight alternative to XML for data-interchange JSON = JavaScript Object Notation

JSON is a light-weight alternative to XML for data-interchange JSON = JavaScript Object Notation JSON The Fat-Free Alternative to XML { Lecture : 27, Course : CSC375, Days : TTh", Instructor : Haidar Harmanani } Why JSON? JSON is a light-weight alternative to XML for data-interchange JSON = JavaScript

More information

AJAX: Rich Internet Applications

AJAX: Rich Internet Applications AJAX: Rich Internet Applications Web Programming Uta Priss ZELL, Ostfalia University 2013 Web Programming AJAX Slide 1/27 Outline Rich Internet Applications AJAX AJAX example Conclusion More AJAX Search

More information

E ECMAScript, 21 elements collection, HTML, 30 31, 31. Index 161

E ECMAScript, 21 elements collection, HTML, 30 31, 31. Index 161 A element, 108 accessing objects within HTML, using JavaScript, 27 28, 28 activatediv()/deactivatediv(), 114 115, 115 ActiveXObject, AJAX and, 132, 140 adding information to page dynamically, 30, 30,

More information

Introduction to JavaScript

Introduction to JavaScript 127 Lesson 14 Introduction to JavaScript Aim Objectives : To provide an introduction about JavaScript : To give an idea about, What is JavaScript? How to create a simple JavaScript? More about Java Script

More information

CGS 3066: Spring 2015 JavaScript Reference

CGS 3066: Spring 2015 JavaScript Reference CGS 3066: Spring 2015 JavaScript Reference Can also be used as a study guide. Only covers topics discussed in class. 1 Introduction JavaScript is a scripting language produced by Netscape for use within

More information

Lesson 14 SOA with REST (Part I)

Lesson 14 SOA with REST (Part I) Lesson 14 SOA with REST (Part I) Service Oriented Architectures Security Module 3 - Resource-oriented services Unit 1 REST Ernesto Damiani Università di Milano Web Sites (1992) WS-* Web Services (2000)

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

AJAX ASYNCHRONOUS JAVASCRIPT AND XML. Laura Farinetti - DAUIN

AJAX ASYNCHRONOUS JAVASCRIPT AND XML. Laura Farinetti - DAUIN AJAX ASYNCHRONOUS JAVASCRIPT AND XML Laura Farinetti - DAUIN Rich-client asynchronous transactions In 2005, Jesse James Garrett wrote an online article titled Ajax: A New Approach to Web Applications (www.adaptivepath.com/ideas/essays/archives/000

More information

<form>. input elements. </form>

<form>. input elements. </form> CS 183 4/8/2010 A form is an area that can contain form elements. Form elements are elements that allow the user to enter information (like text fields, text area fields, drop-down menus, radio buttons,

More information

LECTURE-2. Functions review HTML Forms. Arrays Exceptions Events. CS3101: Scripting Languages: Javascript Ramana Isukapalli

LECTURE-2. Functions review HTML Forms. Arrays Exceptions Events. CS3101: Scripting Languages: Javascript Ramana Isukapalli LECTURE-2 Functions review HTML Forms Arrays Exceptions Events 1 JAVASCRIPT FUNCTIONS, REVIEW Syntax function (params) { // code Note: Parameters do NOT have variable type. 1. Recall: Function

More information

c122mar413.notebook March 06, 2013

c122mar413.notebook March 06, 2013 These are the programs I am going to cover today. 1 2 Javascript is embedded in HTML. The document.write() will write the literal Hello World! to the web page document. Then the alert() puts out a pop

More information

PES DEGREE COLLEGE BANGALORE SOUTH CAMPUS 1 K.M. before Electronic City, Bangalore WEB PROGRAMMING Solution Set II

PES DEGREE COLLEGE BANGALORE SOUTH CAMPUS 1 K.M. before Electronic City, Bangalore WEB PROGRAMMING Solution Set II PES DEGREE COLLEGE BANGALORE SOUTH CAMPUS 1 K.M. before Electronic City, Bangalore 560 100 WEB PROGRAMMING Solution Set II Section A 1. This function evaluates a string as javascript statement or expression

More information

AJAX and PHP AJAX. Christian Wenz,

AJAX and PHP AJAX. Christian Wenz, AJAX and PHP Christian Wenz, AJAX A Dutch soccer team A cleaner Two characters from Iliad A city in Canada A mountain in Colorado... Asynchronous JavaScript + XML 1 1 What is AJAX?

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

The first sample. What is JavaScript?

The first sample. What is JavaScript? Java Script Introduction JavaScript is the most popular scripting language on the internet, and works in all major browsers, such as Internet Explorer, Firefox, Chrome, Opera, and Safari. In this lecture

More information

JSON. Dr. Kanda Runapongsa Saikaew Computer Engineering Department

JSON. Dr. Kanda Runapongsa Saikaew Computer Engineering Department JSON Dr. Kanda Runapongsa Saikaew Computer Engineering Department http://twitter.com/krunapon Agenda What is JSON? JSON vs. XML JSON Tutorial JSON and AJAX Using JSON with Yahoo! Web Services Using JSON

More information

JSON as an XML Alternative. JSON is a light-weight alternative to XML for datainterchange

JSON as an XML Alternative. JSON is a light-weight alternative to XML for datainterchange JSON The Fat-Free Alternative to XML { Lecture : 27, Course : CSC375, Days : TTh", Instructor : Haidar Harmanani } JSON as an XML Alternative JSON is a light-weight alternative to XML for datainterchange

More information

Asynchronous JavaScript + XML (Ajax)

Asynchronous JavaScript + XML (Ajax) Asynchronous JavaScript + XML (Ajax) CSE 190 M (Web Programming), Spring 2008 University of Washington References: w3schools, Wikipedia Except where otherwise noted, the contents of this presentation are

More information

Copyright 2014 Blue Net Corporation. All rights reserved

Copyright 2014 Blue Net Corporation. All rights reserved a) Abstract: REST is a framework built on the principle of today's World Wide Web. Yes it uses the principles of WWW in way it is a challenge to lay down a new architecture that is already widely deployed

More information

RKN 2015 Application Layer Short Summary

RKN 2015 Application Layer Short Summary RKN 2015 Application Layer Short Summary HTTP standard version now: 1.1 (former 1.0 HTTP /2.0 in draft form, already used HTTP Requests Headers and body counterpart: answer Safe methods (requests): GET,

More information

What is Java Script? Writing to The HTML Document. What Can JavaScript do? CMPT 165: Java Script

What is Java Script? Writing to The HTML Document. What Can JavaScript do? CMPT 165: Java Script What is Java Script? CMPT 165: Java Script Tamara Smyth, tamaras@cs.sfu.ca School of Computing Science, Simon Fraser University November 7, 2011 JavaScript was designed to add interactivity to HTML pages

More information

XMLHttpRequest. CS144: Web Applications

XMLHttpRequest. CS144: Web Applications XMLHttpRequest http://oak.cs.ucla.edu/cs144/examples/google-suggest.html Q: What is going on behind the scene? What events does it monitor? What does it do when

More information

Chapter 1 Introduction to Computers and the Internet

Chapter 1 Introduction to Computers and the Internet CPET 499/ITC 250 Web Systems Dec. 6, 2012 Review of Courses Chapter 1 Introduction to Computers and the Internet The Internet in Industry & Research o E Commerce & Business o Mobile Computing and SmartPhone

More information

introjs.notebook March 02, 2014

introjs.notebook March 02, 2014 1 document.write() uses the write method to write on the document. It writes the literal Hello World! which is enclosed in quotes since it is a literal and then enclosed in the () of the write method.

More information

Part of this connection identifies how the response can / should be provided to the client code via the use of a callback routine.

Part of this connection identifies how the response can / should be provided to the client code via the use of a callback routine. What is AJAX? In one sense, AJAX is simply an acronym for Asynchronous JavaScript And XML In another, it is a protocol for sending requests from a client (web page) to a server, and how the information

More information

AJAX: Introduction CISC 282 November 27, 2018

AJAX: Introduction CISC 282 November 27, 2018 AJAX: Introduction CISC 282 November 27, 2018 Synchronous Communication User and server take turns waiting User requests pages while browsing Waits for server to respond Waits for the page to load in the

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

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

Let's Look Back. We talked about how to create a form in HTML. Forms are one way to interact with users

Let's Look Back. We talked about how to create a form in HTML. Forms are one way to interact with users Introduction to PHP Let's Look Back We talked about how to create a form in HTML Forms are one way to interact with users Users can enter information into forms which can be used by you (programmer) We

More information

Session 18. jquery - Ajax. Reference. Tutorials. jquery Methods. Session 18 jquery and Ajax 10/31/ Robert Kelly,

Session 18. jquery - Ajax. Reference. Tutorials. jquery Methods. Session 18 jquery and Ajax 10/31/ Robert Kelly, Session 18 jquery - Ajax 1 Tutorials Reference http://learn.jquery.com/ajax/ http://www.w3schools.com/jquery/jquery_ajax_intro.asp jquery Methods http://www.w3schools.com/jquery/jquery_ref_ajax.asp 2 10/31/2018

More information

XML Processing & Web Services. Husni Husni.trunojoyo.ac.id

XML Processing & Web Services. Husni Husni.trunojoyo.ac.id XML Processing & Web Services Husni Husni.trunojoyo.ac.id Based on Randy Connolly and Ricardo Hoar Fundamentals of Web Development, Pearson Education, 2015 Objectives 1 XML Overview 2 XML Processing 3

More information

PRAjax PHP Reflected Ajax Developer Manual

PRAjax PHP Reflected Ajax Developer Manual PRAjax PHP Reflected Ajax Developer Manual Index PRAjax PHP Reflected Ajax... 1 Index... 2 What is PRAjax?... 3 PRAjax in short... 3 Schematic overview... 4 Introduction... 5 Requirements... 5 Installation...

More information

Then there are methods ; each method describes an action that can be done to (or with) the object.

Then there are methods ; each method describes an action that can be done to (or with) the object. When the browser loads a page, it stores it in an electronic form that programmers can then access through something known as an interface. The interface is a little like a predefined set of questions

More information

/ Introduction to XML

/   Introduction to XML Introduction to XML XML stands for Extensible Markup Language. It is a text-based markup language derived from Standard Generalized Markup Language (SGML). XML tags identify the data and are used to store

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

Jquery.ajax Call Returns Status Code Of 200 But Fires Jquery Error

Jquery.ajax Call Returns Status Code Of 200 But Fires Jquery Error Jquery.ajax Call Returns Status Code Of 200 But Fires Jquery Error The request returns http 200 OK, but the xhr status is 0, error. jquery Ajax Request to get JSON data fires error event to make an ajax

More information

Web Development & Design Foundations with HTML5

Web Development & Design Foundations with HTML5 1 Web Development & Design Foundations with HTML5 CHAPTER 14 A BRIEF LOOK AT JAVASCRIPT Copyright Terry Felke-Morris 2 Learning Outcomes In this chapter, you will learn how to: Describe common uses of

More information

Key features. Nothing to do with java It is the Client-side scripting language Designed to add interactivity to HTML pages

Key features. Nothing to do with java It is the Client-side scripting language Designed to add interactivity to HTML pages Javascript Key features Nothing to do with java It is the Client-side scripting language Designed to add interactivity to HTML pages (DHTML): Event-driven programming model AJAX Great example: Google Maps

More information

BEFORE CLASS. If you haven t already installed the Firebug extension for Firefox, download it now from

BEFORE CLASS. If you haven t already installed the Firebug extension for Firefox, download it now from BEFORE CLASS If you haven t already installed the Firebug extension for Firefox, download it now from http://getfirebug.com. If you don t already have the Firebug extension for Firefox, Safari, or Google

More information

,

, Weekdays:- 1½ hrs / 3 days Fastrack:- 1½hrs / Day [Class Room and Online] ISO 9001:2015 CERTIFIED ADMEC Multimedia Institute www.admecindia.co.in 9911782350, 9811818122 Welcome to one of the highly professional

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

Outline. Introduction to JavaScript Resources What is JavaScript? JavaScript in web pages

Outline. Introduction to JavaScript Resources What is JavaScript? JavaScript in web pages JavaScript CMPT 281 Outline Introduction to JavaScript Resources What is JavaScript? JavaScript in web pages Announcements Layout with tables Assignment 3 JavaScript Resources Resources Why JavaScript?

More information

iframe programming with jquery jquery Summit 2011

iframe programming with jquery jquery Summit 2011 iframe programming with jquery jquery Summit 2011 who invited this guy? name s ben strange last name work at disqus co-author, Third-party JavaScript disqus? dis cuss dĭ-skŭs' third-party commenting platform

More information

Javascript. UNIVERSITY OF MASSACHUSETTS AMHERST CMPSCI 120 Fall 2010

Javascript. UNIVERSITY OF MASSACHUSETTS AMHERST CMPSCI 120 Fall 2010 Lecture 14 Javascript Announcements Project #2 New website Exam#2 No. Class Date Subject and Handout(s) 17 11/4/10 Examination Review Practice Exam PDF 18 11/9/10 Search, Safety, Security Slides PDF UMass

More information

AJAX: The Basics CISC 282 March 25, 2014

AJAX: The Basics CISC 282 March 25, 2014 AJAX: The Basics CISC 282 March 25, 2014 Synchronous Communication User and server take turns waiting User requests pages while browsing Waits for server to respond Waits for the page to load in the browser

More information

jmaki Overview Sang Shin Java Technology Architect Sun Microsystems, Inc.

jmaki Overview Sang Shin Java Technology Architect Sun Microsystems, Inc. jmaki Overview Sang Shin Java Technology Architect Sun Microsystems, Inc. sang.shin@sun.com www.javapassion.com Agenda What is and Why jmaki? jmaki widgets Using jmaki widget - List widget What makes up

More information

October 08: Introduction to Web Security

October 08: Introduction to Web Security October 08: Introduction to Web Security Scribe: Rohan Padhye October 8, 2015 Web security is an important topic because web applications are particularly hard to secure, and are one of the most vulnerable/buggy

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

JavaScript: Introduction, Types

JavaScript: Introduction, Types JavaScript: Introduction, Types Computer Science and Engineering College of Engineering The Ohio State University Lecture 19 History Developed by Netscape "LiveScript", then renamed "JavaScript" Nothing

More information

This tutorial will help you understand JSON and its use within various programming languages such as PHP, PERL, Python, Ruby, Java, etc.

This tutorial will help you understand JSON and its use within various programming languages such as PHP, PERL, Python, Ruby, Java, etc. About the Tutorial JSON or JavaScript Object Notation is a lightweight text-based open standard designed for human-readable data interchange. The JSON format was originally specified by Douglas Crockford,

More information

Writing with YUI. Doug Bell Developer / Janitor

Writing with YUI. Doug Bell Developer / Janitor Writing with YUI Doug Bell Developer / Janitor doug@plainblack.com JavaScript An Epic Tale Interface with Java Applets Has been standardized (EMCAScript) Annoying features being avoided / disabled Featureful,

More information

JavaScript I Language Basics

JavaScript I Language Basics JavaScript I Language Basics Chesapeake Node.js User Group (CNUG) https://www.meetup.com/chesapeake-region-nodejs-developers-group START BUILDING: CALLFORCODE.ORG Agenda Introduction to JavaScript Language

More information

AJAX. Introduction. AJAX: Asynchronous JavaScript and XML

AJAX. Introduction. AJAX: Asynchronous JavaScript and XML AJAX 1 2 Introduction AJAX: Asynchronous JavaScript and XML Popular in 2005 by Google Create interactive web applications Exchange small amounts of data with the server behind the scenes No need to reload

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

REST in Peace Mastering the JSDO with a Dynamic ABL backend. Mike Fechner, Consultingwerk Ltd.

REST in Peace Mastering the JSDO with a Dynamic ABL backend. Mike Fechner, Consultingwerk Ltd. REST in Peace Mastering the JSDO with a Dynamic ABL backend Mike Fechner, Consultingwerk Ltd. mike.fechner@consultingwerk.de http://www.consultingwerk.de/ 2 Consultingwerk Ltd. Independent IT consulting

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

Abstract. 1. Introduction. 2. AJAX overview

Abstract. 1. Introduction. 2. AJAX overview Asynchronous JavaScript Technology and XML (AJAX) Chrisina Draganova Department of Computing, Communication Technology and Mathematics London Metropolitan University 100 Minories, London EC3 1JY c.draganova@londonmet.ac.uk

More information

Arc en Ciel Ltd. Gazetteer Webservice FactSheet

Arc en Ciel Ltd. Gazetteer Webservice FactSheet Arc en Ciel Ltd. Gazetteer Webservice FactSheet Overview We provide two gazetteer webservices: on place name and on street name. The place name service allows a user to browse for any town, village or

More information

IN4MATX 133: User Interface Software

IN4MATX 133: User Interface Software IN4MATX 133: User Interface Software Lecture 13: Components in Angular Professor Daniel A. Epstein TA Jamshir Goorabian TA Simion Padurean 1 Notes Important: please put your name/email/id in the readme.txt

More information

CITS1231 Web Technologies. Ajax and Web 2.0 Turning clunky website into interactive mashups

CITS1231 Web Technologies. Ajax and Web 2.0 Turning clunky website into interactive mashups CITS1231 Web Technologies Ajax and Web 2.0 Turning clunky website into interactive mashups What is Ajax? Shorthand for Asynchronous JavaScript and XML. Coined by Jesse James Garrett of Adaptive Path. Helps

More information

INFS 2150 Introduction to Web Development and e-commerce Technology. Programming with JavaScript

INFS 2150 Introduction to Web Development and e-commerce Technology. Programming with JavaScript INFS 2150 Introduction to Web Development and e-commerce Technology Programming with JavaScript 1 Objectives JavaScript client-side programming Example of a JavaScript program The element

More information

Objectives. Introduction to JavaScript. Introduction to JavaScript INFS Peter Y. Wu, RMU 1

Objectives. Introduction to JavaScript. Introduction to JavaScript INFS Peter Y. Wu, RMU 1 Objectives INFS 2150 Introduction to Web Development and e-commerce Technology Programming with JavaScript JavaScript client-side programming Example of a JavaScript program The element

More information

AJAX: The Basics CISC 282 November 22, 2017

AJAX: The Basics CISC 282 November 22, 2017 AJAX: The Basics CISC 282 November 22, 2017 Synchronous Communication User and server take turns waiting User requests pages while browsing Waits for server to respond Waits for the page to load in the

More information

Such JavaScript Very Wow

Such JavaScript Very Wow Such JavaScript Very Wow Lecture 9 CGS 3066 Fall 2016 October 20, 2016 JavaScript Numbers JavaScript numbers can be written with, or without decimals. Extra large or extra small numbers can be written

More information

JavaScript: The Basics

JavaScript: The Basics JavaScript: The Basics CISC 282 October 4, 2017 JavaScript A programming language "Lightweight" and versatile Not universally respected Appreciated in the web domain Adds programmatic functionality to

More information

AJAX Workshop. Karen A. Coombs University of Houston Libraries Jason A. Clark Montana State University Libraries

AJAX Workshop. Karen A. Coombs University of Houston Libraries Jason A. Clark Montana State University Libraries AJAX Workshop Karen A. Coombs University of Houston Libraries Jason A. Clark Montana State University Libraries Outline 1. What you re in for 2. What s AJAX? 3. Why AJAX? 4. Look at some AJAX examples

More information

Ajax HTML5 Cookies. Sessions 1A and 1B

Ajax HTML5 Cookies. Sessions 1A and 1B Ajax HTML5 Cookies Sessions 1A and 1B JavaScript Popular scripting language: Dynamic and loosely typed variables. Functions are now first-class citizens. Supports OOP. var simple = 2; simple = "I'm text

More information

JavaScript. History. Adding JavaScript to a page. CS144: Web Applications

JavaScript. History. Adding JavaScript to a page. CS144: Web Applications JavaScript Started as a simple script in a Web page that is interpreted and run by the browser Supported by most modern browsers Allows dynamic update of a web page More generally, allows running an arbitrary

More information

Introduction to XML. Asst. Prof. Dr. Kanda Runapongsa Saikaew Dept. of Computer Engineering Khon Kaen University

Introduction to XML. Asst. Prof. Dr. Kanda Runapongsa Saikaew Dept. of Computer Engineering Khon Kaen University Introduction to XML Asst. Prof. Dr. Kanda Runapongsa Saikaew Dept. of Computer Engineering Khon Kaen University http://gear.kku.ac.th/~krunapon/xmlws 1 Topics p What is XML? p Why XML? p Where does XML

More information

At the Forge RJS Templates Reuven M. Lerner Abstract The power of Ajax to fetch and run JavaScript generated by your server-side language. The past few months, I've written a number of articles in this

More information

UI Course HTML: (Html, CSS, JavaScript, JQuery, Bootstrap, AngularJS) Introduction. The World Wide Web (WWW) and history of HTML

UI Course HTML: (Html, CSS, JavaScript, JQuery, Bootstrap, AngularJS) Introduction. The World Wide Web (WWW) and history of HTML UI Course (Html, CSS, JavaScript, JQuery, Bootstrap, AngularJS) HTML: Introduction The World Wide Web (WWW) and history of HTML Hypertext and Hypertext Markup Language Why HTML Prerequisites Objective

More information

JAVASCRIPT AND JQUERY: AN INTRODUCTION (WEB PROGRAMMING, X452.1)

JAVASCRIPT AND JQUERY: AN INTRODUCTION (WEB PROGRAMMING, X452.1) Technology & Information Management Instructor: Michael Kremer, Ph.D. Class 2 Professional Program: Data Administration and Management JAVASCRIPT AND JQUERY: AN INTRODUCTION (WEB PROGRAMMING, X452.1) AGENDA

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

BEST PRACTICES HTML5 SPECIFICATIONS. what's next in data-driven advertising. File Types. HTML5: HTML, JS, CSS, JPG, JPEG, GIF, PNG, and SVG

BEST PRACTICES HTML5 SPECIFICATIONS. what's next in data-driven advertising. File Types. HTML5: HTML, JS, CSS, JPG, JPEG, GIF, PNG, and SVG SPECIFICATIONS HTML5 creatives are a type of display creative that must follow the same guidelines as display creatives with some additional recommendations. The IAB Display Advertising Guidelines (https://www.iab.com/newadportfolio/)

More information

COMS 469: Interactive Media II

COMS 469: Interactive Media II COMS 469: Interactive Media II Agenda Review Ch. 5: JavaScript An Object-Based Language Ch. 6: Programming the Browser Review Data Types & Variables Data Types Numeric String Boolean Variables Declaring

More information

BASIC COMPUTATION. public static void main(string [] args) Fundamentals of Computer Science I

BASIC COMPUTATION. public static void main(string [] args) Fundamentals of Computer Science I BASIC COMPUTATION x public static void main(string [] args) Fundamentals of Computer Science I Outline Using Eclipse Data Types Variables Primitive and Class Data Types Expressions Declaration Assignment

More information

JSP - SYNTAX. Any text, HTML tags, or JSP elements you write must be outside the scriptlet. Following is the simple and first example for JSP:

JSP - SYNTAX. Any text, HTML tags, or JSP elements you write must be outside the scriptlet. Following is the simple and first example for JSP: http://www.tutorialspoint.com/jsp/jsp_syntax.htm JSP - SYNTAX Copyright tutorialspoint.com This tutorial will give basic idea on simple syntax ie. elements involved with JSP development: The Scriptlet:

More information

JavaScript. What s wrong with JavaScript?

JavaScript. What s wrong with JavaScript? JavaScript 1 What s wrong with JavaScript? A very powerful language, yet Often hated Browser inconsistencies Misunderstood Developers find it painful Lagging tool support Bad name for a language! Java

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