Creating Animations, Working with Graphics, and Accessing Data Lesson 9.

Slides:



Advertisements
Similar presentations
17 HTML, Scripting, and Interactivity Section 17.1 Add an audio file using HTML Create a form using HTML Add text boxes using HTML Add radio buttons and.
Advertisements

WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
Introducing JavaScript
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Lecture 6/2/12. Forms and PHP The PHP $_GET and $_POST variables are used to retrieve information from forms, like user input When dealing with HTML forms.
The Web Warrior Guide to Web Design Technologies
DT228/3 Web Development WWW and Client server model.
Kyung Hee University 1 1 Application Layer. 2 Kyung Hee University Position of Application Layer.
Project 1 Introduction to HTML.
Chapter 16 Dynamic HTML and Animation The Web Warrior Guide to Web Design Technologies.
Chapter 9 Introduction to the Document Object Model (DOM) JavaScript, Third Edition.
1st Project Introduction to HTML.
HTML 1 Introduction to HTML. 2 Objectives Describe the Internet and its associated key terms Describe the World Wide Web and its associated key terms.
Chapter ONE Introduction to HTML.
ITIS 1210 Introduction to Web-Based Information Systems Chapter 41 How Animation on the Web Works.
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
INTRODUCTION TO DHTML. TOPICS TO BE DISCUSSED……….  Introduction Introduction  UsesUses  ComponentsComponents  Difference between HTML and DHTMLDifference.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
JavaScript & jQuery the missing manual Chapter 11
Database-Driven Web Sites, Second Edition1 Chapter 8 Processing ASP.NET Web Forms and Working With Server Controls.
Dynamic Web Pages (Flash, JavaScript)
Comp2513 Forms and CGI Server Applications Daniel L. Silver, Ph.D.
© Cheltenham Computer Training 2001 Macromedia Dreamweaver 4 - Slide No 1 Macromedia Dreamweaver 4 Advanced Level Course.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
1 PHP and MySQL. 2 Topics  Querying Data with PHP  User-Driven Querying  Writing Data with PHP and MySQL PHP and MySQL.
WEEK 3 AND 4 USING CLIENT-SIDE SCRIPTS TO ENHANCE WEB APPLICATIONS.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
JavaScript is a client-side scripting language. Programs run in the web browser on the client's computer. (PHP, in contrast, is a server-side scripting.
Section 17.1 Add an audio file using HTML Create a form using HTML Add text boxes using HTML Add radio buttons and check boxes using HTML Add a pull-down.
JavaScript, Fourth Edition
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
Using Client-Side Scripts to Enhance Web Applications 1.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
Introduction.  The scripting language most often used for client-side web development.  Influenced by many programming languages, easier for nonprogrammers.
Term 2, 2011 Week 1. CONTENTS Problem-solving methodology Programming and scripting languages – Programming languages Programming languages – Scripting.
Dynamic web content HTTP and HTML: Berners-Lee’s Basics.
Creating User Interfaces Recap HTML/HTML5 JavaScript features Homework: keep working on user observation studies. Review JavaScript.
Lecture 9: AJAX, Javascript review..  AJAX  Synchronous vs. asynchronous browsing.  Refreshing only “part of a page” from a URL.  Frameworks: Prototype,
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.
XP Tutorial 10New Perspectives on HTML and XHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial.
HTML Form Widgets. Review: HTML Forms HTML forms are used to create web pages that accept user input Forms allow the user to communicate information back.
Introduction to JavaScript CS101 Introduction to Computing.
1 WWW. 2 World Wide Web Major application protocol used on the Internet Simple interface Two concepts –Point –Click.
Jan 2001C.Watters1 World Wide Web and E-Commerce Client Side Processing.
Chapter 16: Ajax-Enabled Rich Internet Applications with XML and JSON TP2543 Web Programming Mohammad Faidzul Nasrudin.
Web Design and Development. World Wide Web  World Wide Web (WWW or W3), collection of globally distributed text and multimedia documents and files 
27.1 Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Internet Applications (Cont’d) Basic Internet Applications – World Wide Web (WWW) Browser Architecture Static Documents Dynamic Documents Active Documents.
Fundamentals of Web DevelopmentRandy Connolly and Ricardo HoarFundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy.
HTML Concepts and Techniques Fifth Edition Chapter 1 Introduction to HTML.
Web Authoring with Dreamweaver. Unit Objectives  Be able to define keywords: HTML, HTTP (protocol), browser, web server, client/server, tag, attribute,
AJAX. Ajax  $.get  $.post  $.getJSON  $.ajax  json and xml  Looping over data results, success and error callbacks.
CHAPTER 8 AJAX & JSON WHAT IS AJAX? Ajax lets you…
Understanding JavaScript and Coding Essentials Lesson 8.
Rich Internet Applications 9. HTML 5 and RIAs. HTML 5 Standard currently under development by W3C Aims to improve the language with support for the latest.
Web Technology (NCS-504) Prepared By Mr. Abhishek Kesharwani Assistant Professor,UCER Naini,Allahabad.
JavaScript and Ajax (JavaScript Environment) Week 6 Web site:
JavaScript Invented 1995 Steve, Tony & Sharon. A Scripting Language (A scripting language is a lightweight programming language that supports the writing.
Unit 4 Working with data. Form Element HTML forms are used to pass data to a server. A form can contain input elements like text fields, checkboxes, radio-buttons,
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.
4.3. Code animations by using JavaScript Access data access by using JavaScript. Creating Animations, Working with Graphics, and Accessing Data.
National College of Science & Information Technology.
Chapter 1 Introduction to HTML.
Section 17.1 Section 17.2 Add an audio file using HTML
Tutorial (4): HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
The Application Lifecycle
Chapter 27 WWW and HTTP.
Tutorial 10: Programming with javascript
Presentation transcript:

Creating Animations, Working with Graphics, and Accessing Data Lesson 9

Exam Objective Matrix Skills/ConceptsMTA Exam Objectives Coding Animations by Using JavaScript Code animations by using JavaScript. (4.3) Working with Images, Shapes, and Other Graphics Code animations by using JavaScript. (4.3) Sending and Receiving DataAccess data access by using JavaScript. (4.4) Loading and Saving FilesAccess data access by using JavaScript. (4.4) Using JavaScript to Validate User Form Input Access data access by using JavaScript. (4.4) Understanding and Using Cookies Access data access by using JavaScript. (4.4) Understanding and Using LocalStorage Access data access by using JavaScript. (4.4)

Animation Animation is the display of a sequence of static images at a fast enough speed to create the illusion of movement. Regarding the user interface, animation has to do with changing a display to make it dynamic—not just a one-time change but a seamless one. JavaScript can produce spectacular animation effects.

Recursion Recursion is a programming technique in which a function calls itself. Recursion is a key part of animation. The most effective way to introduce a “timing element” into JavaScript is to use setTimeout recursively. –Have it invoke another execution of the same function from which the setTimeout() was called.

A Simple Animation Example

A Simple Animation Example (Continued)

createElement Method You can use the JavaScript createElement method to display an image when a button is clicked or some other event occurs.

Canvas Element To draw a canvas object, use: –getElementById() function to find the canvas element –canvas.getContext to create the canvas object Then use a variety of methods to draw shapes, include images, and so on.

Canvas Example: Analog Clock

Canvas Example: Analog Clock (Continued)

Sending and Receiving Data One of the most essential techniques for data transfer involves the XMLHttpRequest API. –Sometimes abbreviated as XHR XMLHttpRequest enables you to use JavaScript to pass data in the form of text strings between a client and a server.

XMLHttpRequest General syntax:

XMLHttpRequest The XMLHttpRequest object creates a call to the server. The open method specifies the HTTP method for contacting the server and provides the server’s Web address. The callback function gets a response from the server. xhr.send(data) sends the data.

Accessing Data Example

Parsing Parsing is a term used to describe analysis of complex information into constituent parts. Use parsing for extracting information from a data stream of stock quotes and similar tasks.

Parsing Example

JSON You can also use JSON.parse and JSON.stringify APIs to exchange JavaScript objects with a server.

Loading and Saving Files JavaScript can access files on a local computer and, using HTML5, validate the file type before loading, which greatly reduces errors.

Access a Local File Example

Access a Local File Example (Continued)

Application accepts image files but not other formats

Access a Local File Example (Continued) Application accepts image files but not other formats

AppCache AppCache saves a copy of Web site files locally, in a structured form. AppCache is not the same as a browser’s cache. Whereas a browser’s cache saves all Web pages visited, AppCache saves only the files listed in the cache manifest.

AppCache Example

Data Types A data type is JavaScript’s interpretation of the kind of data a program can work with. Data types include: – string –Number –Array –Boolean –Null –Object –undefined

User Input Form Validation As end users enter data in a form, JavaScript can instantly validate entries and suggest alternatives.

Client-side Validation Example

Client-side Validation Example (Continued)

Cookies Cookies are small text files that Web sites save to a computer’s hard disk that contain information about the user and his or her browsing preferences. The content of cookies change as a user revisits a site and selects different items or changes preferences. In JavaScript, a cookie is a variable. JavaScript can create and retrieve cookies.

Use Cookies Example

Local Storage HTML5’s Local Storage feature has better security and makes programming easier than with cookies.

Recap Animation Recursion createElement method Canvas Sending and receiving data XMLHttpRequest API Accessing a local file AppCache Data types User input form validation/client-side validation Cookies Local Storage