Presentation is loading. Please wait.

Presentation is loading. Please wait.

4.3. Code animations by using JavaScript. 4.4. Access data access by using JavaScript. Creating Animations, Working with Graphics, and Accessing Data.

Similar presentations


Presentation on theme: "4.3. Code animations by using JavaScript. 4.4. Access data access by using JavaScript. Creating Animations, Working with Graphics, and Accessing Data."— Presentation transcript:

1 4.3. Code animations by using JavaScript. 4.4. Access data access by using JavaScript. Creating Animations, Working with Graphics, and Accessing Data

2 Agenda Animations Canvas + JavaScript Transmitting Data Loading and Saving Files Validating Form Input Cookies

3

4 Animation with JavaScript

5 Creating Animations

6

7 Manipulating the Canvas Recall that the canvas element is used to create a container for graphics With JavaScript, you can manipulate the container and draw graphics dynamically To draw a canvas object, you use the getElementById() function to access the canvas and the canvas.getContext to create the object

8 Canvas Demo Your browser does not support the canvas element. var c=document.getElementById("myCanvas"); var ctx=c.getContext("2d"); ctx.fillStyle="Blue"; ctx.fillRect(5,5,150,75); Example: Cut The Rope

9

10 Sending and Receiving Data CLIENT

11 The XMLHttpRequest API function load(url, data, callback) { var xhr = new XMLHttpRequest(); xhr.open("GET", url, true); xhr.onload = function() { callback(xhr.responseText); } xhr.send(data); } JavaScript

12 Parsing

13 JavaScript Object Notation (JSON)

14

15 Validating Uploaded Files VS.

16 AppCache for Offline Files Data can be stored locally when a user is offline using the Application Cache, or AppCache AppCache stores resources, such as HTML, CSS, and JavaScript files, locally on a user’s machine As a result, users can access Web pages and apps offline The cache manifest file dictates which type of information is stored offline

17

18 Validating User Input First Name Last Name Email Address Jane Doe jane@live Please provide a valid email address.

19

20 Cookies

21 Agenda Animations Canvas + JavaScript Transmitting Data Loading and Saving Files Validating Form Input Cookies

22 © 2015 Microsoft Corporation. All rights reserved.

23


Download ppt "4.3. Code animations by using JavaScript. 4.4. Access data access by using JavaScript. Creating Animations, Working with Graphics, and Accessing Data."

Similar presentations


Ads by Google