Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to AJAX MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/4/2016.

Similar presentations


Presentation on theme: "Introduction to AJAX MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/4/2016."— Presentation transcript:

1 Introduction to AJAX MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/4/2016

2 Course Overview New tools Weeks 1 - 5 Using a web framework Weeks 6 -8 Using a mobile device IDE Weeks 9-10 The class project (It’s a bake off!) Weeks 11-15 We are (still) here Slide 2 Arrays PDO MVC JavaScript / JSON

3 Recall from last time… URL, referencing a.php page HTTP Response Database PHP Interpreter Browser JavaScript Engine Slide 3 As a general rule, JavaScript lives here, in the browser, and does not interact with any resource outside the browser. This is called a “round trip”

4 The DOM (Document Object Model) Slide 4 JavaScript can change all the HTML elements in the page JavaScript can change all the HTML attributes in the page JavaScript can change all the CSS styles in the page JavaScript can remove existing HTML elements and attributes JavaScript can add new HTML elements and attributes JavaScript can react to all existing HTML events in the page JavaScript can create new HTML events in the page Source: http://www.w3schools.com/js/js_htmldom.asp All of these activities are accomplished through the properties and methods of objects.

5 So, what’s AJAX? 5 AJAX is short for Asynchronous JavaScript and XML It is the combination of these technologies, not a separate technology in itself It’s kind of sneaky…

6 AJAX uses JavaScript to call web services 6 URL, referencing a.php page HTTP Response Database PHP Interpreter Browser JavaScript Engine Less of this

7 AJAX uses JavaScript to call resources 7 Database PHP Interpreter Browser JavaScript Engine HTTP Requests More of this

8 AJAX uses JavaScript to call resources 8 Browser JavaScript Engine Let’s take a closer look at JavaScript and the DOM

9 AJAX uses JavaScript to call resources 9 XMLHttpRequest() The term "AJAX" was publicly stated on 18 February 2005 by Jesse James Garrett in an article titled "AJAX: A New Approach to Web Applications", based on techniques used on Google pages. This object acts like a browser, inside the browser.

10 XMLHttpRequest allows us to do things like this… Slide 10

11 XMLHttpRequest allows us to do things like this… Slide 11 Look at the parameter. Is there something to do?

12 XMLHttpRequest allows us to do things like this… Slide 12 Ah! There *is* something to do

13 XMLHttpRequest allows us to do things like this… Slide 13 “listen” for the readystate property to change. When it does, execute this function.

14 XMLHttpRequest allows us to do things like this… Slide 14 This is an “anonymous function”, a function defined inside of a function. (Pretty crazy, huh?)

15 XMLHttpRequest allows us to do things like this… Slide 15 Get ready to open a page. Use the GET method. Specify the page. Asynchronous = true.

16 XMLHttpRequest allows us to do things like this… Slide 16 Go get the page.

17 Slide 17 It’s time for an experiment!


Download ppt "Introduction to AJAX MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/4/2016."

Similar presentations


Ads by Google