CS 142 Lecture Notes: FormsSlide 1 AJAX Basics xhr = new XMLHttpRequest(); xhr.onreadystatechange = xhrHandler(); xhr.open("POST", url); xhr.send(postData);...

Slides:



Advertisements
Similar presentations
CS 142 Lecture Notes: FormsSlide 1 Simple Form Product: Price:
Advertisements

CS 142 Lecture Notes: FormsSlide 1 Simple Form Product: Price:
getElementById() document.getElementById(“idName").innerHTML = “Any valid content"; getElementById is a method innerHTML is a property.
Modern JavaScript Develop And Design Instructor’s Notes Chapter 11– Ajax Modern JavaScript Design And Develop Copyright © 2012 by Larry Ullman.
9. AJAX & RIA. 2 Motto: O! call back yesterday, bid time return. — William Shakespeare.
CS 142 Lecture Notes: FormsSlide 1 Simple Form Value1: Value2:
19-Jun-15 Ajax. The hype Ajax (sometimes capitalized as AJAX) stands for Asynchronous JavaScript And XML Ajax is a technique for creating “better, faster,
AJAX (Asynchronous JavaScript and XML) Amit Jain CS 590 – Winter 2008.
CS 142 Lecture Notes: FormsSlide 1 Simple Form Value1: Value2:
CS 142 Lecture Notes: AjaxSlide 1 AJAX Basics xhr = new XMLHttpRequest(); xhr.onreadystatechange = xhrHandler; xhr.open("POST", url); xhr.send(postData);...
1 JavaScript & AJAX CS , Spring JavaScript.
Prof. James A. Landay University of Washington Spring 2008 Web Interface Design, Prototyping, and Implementation Rich Internet Applications: AJAX, Server.
CSCI 6962: Server-side Design and Programming Introduction to AJAX.
Lecture 12 – AJAX SFDV3011 – Advanced Web Development Reference: 1.
Intro to JavaScript Events. JavaScript Events Events in JavaScript let a web page react to some type of input Many different ways to handle events due.
CS 190 Lecture Notes: Tweeter ProjectSlide 1 Uniform Resource Locators (URLs) Scheme Host.
Ajax - 1h. AJAX IS: A browser technology A technology that uses only JavaScript in the browser page A very efficient way of updating information A way.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 16 Introduction to Ajax.
Saving Form Data You can save form data in Google Spreadsheets using the following steps. 1.Create a Google Spreadsheet in your documents 2.Use Tools to.
Lecture 9: AJAX, Javascript review..  AJAX  Synchronous vs. asynchronous browsing.  Refreshing only “part of a page” from a URL.  Frameworks: Prototype,
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.
School of Computing and Information Systems CS 371 Web Application Programming AJAX.
Creating Dynamic Webpages
AJAX in ASP.NET MVC AJAX, Partial Page Rendering, jQuery AJAX, MVC AJAX Helpers SoftUni Team Technical Trainers Software University
 AJAX – Asynchronous JavaScript and XML  Ajax is used to develop fast dynamic web applications  Allows web pages to be updated asynchronously by transferring.
SE-2840 Dr. Mark L. Hornick 1 Introduction to Ajax Asynchronous Javascript And XML.
AJAX. Overview of Ajax Ajax is not an API or a programming language Ajax aims to provide more responsive web applications In normal request/response HTTP.
AJAX. Ajax  $.get  $.post  $.getJSON  $.ajax  json and xml  Looping over data results, success and error callbacks.
CS 142 Lecture Notes: FormsSlide 1 Simple Form Product: Price:
CHAPTER 8 AJAX & JSON WHAT IS AJAX? Ajax lets you…
Dave Salinas. What is XML? XML stands for eXtensible Markup Language Markup language, like HTML HTML was designed to display data, whereas XML was designed.
AJAX CS456 Fall Examples Where is AJAX used? Why do we care?
1 AJAX. AJAX – Whatzit? Asynchronous (content loading)‏ Javascript (logic & control)‏ And XML (request handling)‏
Section led by Ivan Lee Reachable at ivan period lee at cs period stanford period edu 1.
JavaScript, Sixth Edition Chapter 11 Updating Web Pages with Ajax.
NCCUCS 軟體工程概論 Lecture 5: Ajax, Mashups April 29, 2014.
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.
Test1 Here some text. Text 2 More text.
AJAX and JSON Day 8.
CSE 154 Lecture 11: AJAx.
Understanding XMLHttpRequest
CS 371 Web Application Programming
AJAX and jQuery AJAX AJAX Concepts, XMLHttpRequest, jQuery AJAX: $.ajax(), $.get(), $.post() jQuery AJAX XMLHttpRequest SoftUni Team Technical Trainers.
Callback Function function passed as a parameter to another function
Getting web pages First we need to get the webpage by issuing a HTTP request. The best option for this is the requests library that comes with Anaconda:
CSE 154 Lecture 11: AJAx.
CSE 154 Lecture 22: AJAX.
JavaScript & AJAX.
AJAX Basics xhr = new XMLHttpRequest();
Asynchronous Javascript And XML
CS 140 Lecture Notes: Protection
CS 140 Lecture Notes: Protection
[type text here] [type text here] [type text here] [type text here]
AJAX Basics xhr = new XMLHttpRequest();
Your text here Your text here Your text here Your text here Your text here Pooky.Pandas.
JavaScript & jQuery AJAX.
AJAX Basics xhr = new XMLHttpRequest();
Your text here Your text here Your text here Your text here
[type text here] [type text here] [type text here] [type text here]
CS 140 Lecture Notes: Protection
Chengyu Sun California State University, Los Angeles
Lecture 12: The Fetch Api and AJAx
AJAX CS-422 Dick Steflik.
Chengyu Sun California State University, Los Angeles
Ajax and JSON Jeremy Shafer Department of MIS Fox School of Business
Chengyu Sun California State University, Los Angeles
Uniform Resource Locators (URLs)
Ajax and JSON Jeremy Shafer Department of MIS Fox School of Business
Presentation transcript:

CS 142 Lecture Notes: FormsSlide 1 AJAX Basics xhr = new XMLHttpRequest(); xhr.onreadystatechange = xhrHandler(); xhr.open("POST", url); xhr.send(postData);... function xhrHandler() { if (this.readyState != 4) { return; } if (this.status != 200) { // Handle error... return; }... var text = this.responseText; var document = this.responseXML; } State 4 means “done” Response available as raw text or XML

CS 142 Lecture Notes: FormsSlide 2 Higher-Level AJAX Example <%= observe_field( "userName", :frequency => 0.25, :update => "completionMenu", :url => {:action => "nameChoices"} ) %> Watch this element for change Replace this element’s innerHTML with response Issue AJAX request here

CS 142 Lecture Notes: FormsSlide 3 JSON Example {name: "Alice", gpa: 3.5, friends: ["Bill", "Carol", "David"]}

CS 142 Lecture Notes: FormsSlide 4