Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
• Session state
• Application state
• Persisting state information
• States of an application
GUIDING QUESTIONS Lesson 1.2
Feature Detection
Directions:
• Read the scenario described in the In-Class Activity document.
• Answer the questions that follow.
REVIEW Lesson 1.2
MSDN Resources
HTML5 Tutorial http://msdn.microsoft.com/en-
us/ie/aa740476
Internet Explorer® 9 Guide for http://msdn.microsoft.com/en-
Developers us/ie/hh410106
Other Resources
How to use an Application http://www.html5rocks.com/en/tutorials/a
Cache ppcache/beginner/
W3Schools http://www.w3schools.com/html5/
Schmitt, Christopher and Kyle Simpson. HTML5 Cookbook (Sebastopol: O'Reilly
2012).
MTA EXAM 98-375
HTML5 Application Development
Fundamentals
98-375: OBJECTIVE 1
Manage the Application Life Cycle
LESSON 1.3
Debug and test an
HTML5-based touch-
enabled application
OVERVIEW Lesson 1.3
Touch-Enabled Demonstration
Touch-Enabled Devices
What are the pros and cons of touch-enabled devices?
IN-CLASS ACTIVITY Lesson 1.3
Directions:
• Read the scenario in the activity and answers the questions.
• Work with a partner to brainstorm additional ideas for the site.
REVIEW Lesson 1.3
MSDN Resources
HTML5 Tutorials http://msdn.microsoft.com/en-
us/ie/aa740476
Internet Explorer Test Drive http://ie.microsoft.com/testdrive/Default.ht
ml
Internet Explorer 9 Guide for http://msdn.microsoft.com/en-
Developers us/ie/hh410106
Other Resources
W3Schools http://www.w3schools.com/html5/
W3C Mobile Device Validator http://validator.w3.org/mobile/
Mobile Validator http://ready.mobi/
MTA EXAM 98-375
HTML5 Application Development
Fundamentals
98-375: OBJECTIVE 1
Manage the Application Life Cycle
LESSON 1.4
Publish an application
to a store
OVERVIEW Lesson 1.4
• Prior to publishing, how can you ensure that your application works
as expected?
• List the steps necessary to publish an application.
• What is the purpose of a launcher icon?
LECTURE Lesson 1.4
Publishing Tasks
1. Gather materials for release
Prepare EULA, get cryptographic keys, create application icon.
2. Configure application for release
Remove debugging and logging settings, configure manifest
settings, clean up project.
3. Build application for release
Build application for release and sign application.
PUBLISHING TASKS CONTINUED
4. Prepare remote servers
Prepare remote servers and services for production, update
resources for release.
5. Test application for release
Test the signed application for release and distribution.
DEMONSTRATION Lesson 1.4
Launcher Icons
Application Testing
• Identify the key components of testing an application prior to
publishing to an application store such as the Windows Store.
IN-CLASS ACTIVITY Lesson 1.4
Directions:
• Recall an application that you have already created, or think of one
you want to create.
• Write a brief description of the application .
• Use Expression Design to create a launcher icon for the application.
REVIEW Lesson 1.4
• Prior to publishing, how can you ensure that your application works
as expected?
• List the steps necessary to publish an application.
• What is the purpose of a launcher icon?
ADDITIONAL RESOURCES Lesson 1.4
MSDN Resources
Windows Store for developers http://blogs.msdn.com/b/windowsstore/arc
hive/2011/12/06/announcing-the-new-
windows-store.aspx
Windows Phone Marketplace http://msdn.microsoft.com/en-
us/library/hh202930(VS.92).aspx?ocid=otc
-n-nz-dca-gzdcao
Other Resources
Android Developers http://developer.android.com/guide/publis
hing/preparing.html
MTA EXAM 98-375
HTML5 Application Development
Fundamentals
98-375: OBJECTIVE 2
Build the User Interface by Using
HTML5
LESSON 2.1
Choose and configure
HTML5 tags to display
text content
OVERVIEW Lesson 2.1
HTML5 Support
If HTML5 is not fully supported by all browsers, does it make sense to
use it now?
IN-CLASS ACTIVITY Lesson 2.1
Directions:
• Read the scenario in the In-Class Activity.
• Use the resources mentioned in this PowerPoint ® presentation and
your own investigative skills to answer the questions.
• Part of the activity includes creating an HTML5 page with the
following new tags:
– Header
– Footer
– Small
– Mark
REVIEW Lesson 2.1
MSDN Resources
Internet Explorer® http://msdn.microsoft.com/en-us/ie/aa740476
Learning:
Learn HTML5 in 5 http://msdn.microsoft.com/en-us/hh549253
Minutes
Other Resources
Complete set of HTML5 http://dev.w3.org/html5/markup/elements.html#el
elements ements
W3 Schools http://www.w3schools.com/html5
MTA EXAM 98-375
HTML5 Application Development
Fundamentals
98-375: OBJECTIVE 2
Build the User Interface by Using
HTML5
LESSON 2.2
Choose and configure
HTML5 tags to display
graphics
OVERVIEW Lesson 2.2
• What code can developers include to test for browser support of the
new HTML5 <canvas> tag?
LECTURE Lesson 2.2
Canvas Specifications
• The Canvas element uses a standard HTML5 header, <!doctype
html>, so that browsers can distinguish it as part of the HTML5
specification.
• The <canvas> tag is included in the body and must specify the
width and height.
• An ID is assigned to the tag so that it can be part of the Document
Object Model (DOM).
• The developer also must specify which function is called when the
canvas is clicked.
• The <script> portion of the page has two sections: one for drawing
the user interface and the other for processing the click event on the
user interface.
DEMONSTRATION Lesson 2.2
X- direction
Directions:
• Read the scenario.
• Open the URL provided.
• Read the entire section before beginning to create a game.
• Working in pairs, have one person program the game using SVG,
and have the other program using the canvas.
• Answer the questions in the activity.
REVIEW Lesson 2.2
MSDN Resources
Internet Explorer® Learning - http://msdn.microsoft.com/en-
HTML5 us/ie/aa740476
HTML5 Graphics http://msdn.microsoft.com/en-
us/library/gg589511(v=VS.85).aspx
Other Resources
Modernizr http://www.modernizr.com/
The Canvas Element http://www.w3.org/TR/html5/the-canvas-
element.html#the-canvas-element
Lubbers, Peter; Albers, Brian; Smith, Ric; Salim, Frank (2010-09-01). Pro HTML5
Programming: Powerful APIs for Richer Internet Application Development (Kindle
Location 161). Apress. Kindle Edition. later lesson?
98-375: OBJECTIVE 1
Manage the Application Life Cycle
LESSON 1.1
Understand the
platform fundamentals
OVERVIEW Lesson 1.1
Host Process
• With the variety of products that users can use to view a website or
application, it is even more critical to choose the right host.
• To become active, a service must be hosted within a run-time
environment that creates it and controls its context and lifetime.
• A hosting environment must meet the needs of the application
deployment, such as:
o IIS - Internet Information Services
o Managed application
o Windows® Services
LECTURE Lesson 1.1
Directions:
• Read the scenario described in the In-class Activity document.
• Answer the questions that follow.
REVIEW Lesson 1.1
Using Audio
• With HTML5, you can add a music player to a web page without
requiring a third-party plug-in or add-on.
• Tags specify the sound or audio content, such as music or effects, to
be played in a document.
• The control attribute adds audio controls, such as play, pause, and
volume.
• It is a good practice to add text content between the <audio> and
</audio> tags for browsers that do not support the <audio>
element.
LECTURE Lesson 2.3
Using Video
• Video files contain audio tracks, video tracks, and additional
metadata that are combined at run time to play the video.
• Coders/decoders are algorithms used to encode and decode both
audio and video. Raw files are huge and too large to travel across
the Internet.
• The video tag requires a height and width attribute.
Directions:
• Search the HTML5 sites for a definition of the video tag poster
attribute.
• Create a one-page website for Margie’s Travel.
• Add an HTML5 page that uses a poster to introduce a video on a
“how to” topic, such as “How to say Hello in French.“
REVIEW Lesson 2.3
MSDN Resources
HTML5 Audio and Video http://msdn.microsoft.com/en-
us/library/gg589509(v=VS.85).aspx
Internet Explorer 9 Guide for http://msdn.microsoft.com/en-
Developers us/ie/hh410106#_HTML5_video_audio
Other Resources
W3C Audio Element Definition http://www.w3.org/TR/html5/the-iframe-
element.html#the-audio-element
W3C Video Element Definition http://www.w3.org/TR/html5/the-iframe-
element.html#the-video-element
HTML5 Tutorial http://www.w3schools.com/html5/default.a
sp
Lubbers, Peter; Albers, Brian; Smith, Ric; Salim, Frank (2010-09-01). Pro HTML5
Programming: Powerful APIs for Richer Internet Application Development (Kindle
Location 161). Apress. Kindle Edition.
MTA EXAM 98-375
HTML5 Application Development
Fundamentals
98-375: OBJECTIVE 2
Build the User Interface by Using
HTML5
LESSON 2.4
Choose and configure
HTML5 tags to
organize content and
forms
OVERVIEW Lesson 2.4
• Tables
• Lists
• Sections
• Semantic HTML
GUIDING QUESTIONS Lesson 2.4
• Explain how the new HTML5 section tags are used to organize
content and forms.
LECTURE Lesson 2.4
Tables in HTML5
• HTML5 did not change the syntax for creating a table on a web
page, but it is important to review the table attributes because
HTML5 no longer supports these attributes.
• Developers will need to use Cascading Style Sheets (CSS) instead.
• Some of the attributes not supported:
» <table> does not support: cellpadding, cellspacing, frame, rules,
summary, and width.
» <td> and <th> do not support attributes: abbr, align, height, valign,
width, and more.
» <thead> and <tr> do not have any supported attributes.
LECTURE Lesson 2.4
Lists
• With HTML5, the input element can contain a list attribute.
• With this attribute, the developer can provide a list of values for the user
to choose from or add his or her own value.
• This list is referred to as a datalist. Example:
<input list = “browsers” autocomplete />
<datalist id=“browsers”>
<option value = “Internet Explorer”>
<option value = “Firefox”>
<option value = “Google Chrome”>
<option value = “Opera”>
<option value = “Safari”>
</datalist>
LECTURE Lesson 2.4
Sections
• Sectioning elements are added to organize content into logical
divisions of the document.
• Using sections is great for creating outlines and provides an easy
format for interacting with the page programmatically.
• HTML5 includes additional sectioning elements that are useful for
organizing content:
• <article>, <aside>, <nav>, <section>
• <header>, <footer>, <hgroup>
LECTURE Lesson 2.4
Syntactic to Semantic
• All new HTML5 tags are defined with meaningful semantic names
such as <mark>, which is used to mark/highlight text, <meter>,
<progress>, <time>, etc.
• HTML5 tags are redefining the meaning of the HTML tag.
• Examples:
» "My name is <em>Peggy</em> not Margaret” (adds emphatic
stress to the word Peggy).
» Acronyms and abbreviations are combined into one tag:
<abbr title=“Microsoft Developer
Network”>MSDN</abbr>
DEMONSTRATION Lesson 2.4
Creating an Outline
In this demonstration, you will see how to:
Directions:
• Use the information from the discussion questions on the previous
slide to draw the layout of a blog page.
• Identify each section of the blog using the new HTML section tags:
header, hgroup, nav, article, and aside.
• Use Microsoft® Expression® Web to create a one-page website.
• Add the HTML5 tags to create the layout of a blog page.
REVIEW Lesson 2.4
• Explain how the new HTML5 section tags are used to organize
content and forms.
ADDITIONAL RESOURCES Lesson 2.4
MSDN Resources
Internet Explorer® Learning – http://msdn.microsoft.com/en-
HTML5 us/ie/aa740476
Internet Explorer 9 Developer http://msdn.microsoft.com/en-
Guide > HTML5 – Internet us/ie/hh410106
Explorer 9 Guide for Developers
Other Resources
HTML5 Outlines http://webdesign.about.com/od/html5tutor
Why HTML5 Outlines Are ials/a/html5-outlines.htm
Important
W3 Schools http://www.w3schools.com/html5/html5_re
ference.asp
MTA EXAM 98-375
HTML5 Application Development
Fundamentals
98-375: OBJECTIVE 2
Build the User Interface by Using
HTML5
LESSON 2.5
Choose and configure
HTML5 tags for input
and validation
OVERVIEW Lesson 2.5
• How does the use of semantic tags make creating forms easier?
LECTURE Lesson 2.5
• Create a form.
• Add form input elements that use the new HTML5 syntax.
• Test it in a compatible browser.
DISCUSSION Lesson 2.5
Directions:
• This activity is designed to use the new HTML5 tags for inputting
data, validating data, including data lists, and providing placeholder
text.
• Review the list of new input types.
• Use the new types to convert existing form data to specific field
types for better data validation.
REVIEW Lesson 2.5
• How are the new form elements (progress, meter, datalist, keygen,
and output) providing added value to a web page?
• How does the use of semantic tags help make building forms easier?
ADDITIONAL RESOURCES Lesson 2.5
MSDN Resources
Better Web Forms with HTML5 http://msdn.microsoft.com/en-
Forms us/magazine/hh547102.aspx
Internet Explorer® Learning http://msdn.microsoft.com/en-
us/ie/aa740476
Other Resources
Making Forms Fabulous with http://www.html5rocks.com/en/tutorials/fo
HTML5 rms/html5forms/
W3 Schools http://www.w3schools.com/html5
MTA EXAM 98-375
HTML5 Application Development
Fundamentals
98-375: OBJECTIVE 3
Format the User Interface by
Using CSS
LESSON 3.1
Understand the core
CSS concepts
OVERVIEW Lesson 3.1
• An inline element, such as a span, typically does not start a new line
and is sized according to the height and width of its own content.
• Examples of inline elements: <span>, <a>
LECTURE Lesson 3.1
Directions:
MSDN Resources
Internet Explorer® Learning – http://msdn.microsoft.com/en-
CSS3 us/ie/gg593671
Cascading Style Sheets http://msdn.microsoft.com/en-
us/library/ms531205(v=vs.85).aspx
Other Resources
W3 Schools CSS Tutorial http://www.w3schools.com/css/default.asp
About: What is CSS? http://webdesign.about.com/od/xhtml/u/ht
mlcssxml.htm#s5
MTA EXAM 98-375
HTML5 Application Development
Fundamentals
98-375: OBJECTIVE 3
Format the User Interface by Using
CSS
LESSON 3.2
Arrange user interface
(UI) content by using
CSS
OVERVIEW Lesson 3.2
• Using the Flexible Box Model and grid layouts to establish content
alignment, direction, and orientation.
• Proportional scaling and the use of “free space” for elements within
a flexible box or grid.
• Ordering and arranging content.
• Concepts for using flexbox for simple layouts and grid for complex
layouts.
• Grid content properties for rows and columns.
• Using application templates.
GUIDING QUESTIONS Lesson 3.2
• What additional features are added to the box model by using the
Flexible Box Model?
• What are the various ways to allocate excess space using the Flexible
Box Model?
• How does the new Flexible Box Model eliminate the need for using
float?
LECTURE Lesson 3.2
Expected outcome:
CSS is listed on next page
FLEXIBLE BOX CONTINUED
Directions:
• Read the scenario in the In-class Activity
• Use the resources mentioned in this PowerPoint ® presentation and
your own investigative skills to answer the questions.
• Part of the activity includes drawing a web page with a flexbox
container and identifying the following properties:
– box-orient
– box-pack
– box-align
– box-flex
– box-direction
REVIEW Lesson 3.2
• What additional features are added to the box model by using the
Flexible Box Model?
• What are the various ways to allocate excess space using the Flexible
Box Model?
• How does the new Flexible Box Model eliminate the need for using
float?
ADDITIONAL RESOURCES Lesson 3.2
MSDN Resources
Flexible box (“Flexbox”) http://msdn.microsoft.com/en-
Layout us/library/hh673531(v=vs.85).aspx
CSS http://msdn.microsoft.com/en-
us/library/hh673536(v=vs.85)
Other Resources
Test Drive Hands-on: http://ie.microsoft.com/testdrive/Graphics/hands-
Windows® 8 HTML5 on-css3/hands-on_flex.htm
Platform
• What new CSS3 properties can help when the words are too long to
fit in the content container?
LECTURE Lesson 3.3
Regions and Using Regions to Flow Text Content
between Multiple <div> Sections
• Content source, content container, dynamic flow, flow-into, flow-
from, msRegionUpdate, msRegionOverflow, msGetRegionContent().
• Provides pagination for HTML content.
• Defines content sources using the flow-into and flow-from.
• Regions are content containers that use msRegion Update,
msRegion Overflow, and msGetRegionConent().
• Developers and designers can take a single HTML content stream of
text and images and segment that stream into multiple empty
containers defined in a standard HTML template.
• Provides a more suitable layout for varying graphic devices such as a
tablet.
REGIONS CONTINUED
• CSS positioned floats allow you to create web pages in which text
and other content can wrap around specific elements.
• A positioned float can be absolutely positioned relative to a
container, allowing text to flow around it.
DEMONSTRATION Lesson 3.3
Flow of Text
Compare and contrast the current ways to organize text on a page vs.
using the regions, columns, and hyphenation properties available with
CSS3.
Directions:
• Read the scenario in the In-class Activity.
• Use the resources mentioned in this PowerPoint® presentation and
your own investigative skills to answer the questions.
• Part of the activity includes creating an HTML5 page with CSS
properties for creating regions in a web page.
REVIEW Lesson 3.3
• What new CSS3 properties can help when the words are too long to
fit in the content container?
ADDITIONAL RESOURCES Lesson 3.3
MSDN Resources
Regions http://msdn.microsoft.com/en-
Hyphenation us/library/hh673536(v=VS.85).aspx
Multi-Column Layout
Windows® Dev Center http://msdn.microsoft.com/en-
Positioned Floats us/library/windows/apps/hh453704.aspx
Other Resources
Adobe Developer http://www.adobe.com/devnet/html5/articles/css3
Connection/CSS3 -regions.html
Regions
W3 Schools CSS3 multi- http://www.w3schools.com/cssref/default.asp#mul
columns ticol
MTA EXAM 98-375
HTML5 Application Development
Fundamentals
98-375: OBJECTIVE 3
Format the User Interface by Using
CSS
LESSON 3.4
Manage the graphical
interface by using CSS
OVERVIEW Lesson 3.4
• How can the new Cascading Style Sheets 3 (CSS3) properties enable
the use of fonts that are not pre-loaded on a client PC?
• What impact does CSS3 have on the new HTML5 tags used for a
drawing canvas and SVG elements?
LECTURE Lesson 3.4
2D and 3D Transformations
• Translate, scale, rotate, skew, and 3D perspective transitions and
animations.
• The translate() method moves the element from its current
position, depending on the parameters given for the left (X-
axis) and the top (Y-axis) position.
• The scale() method increases or decreases the size of the
element, depending on the parameters given for the width (X-
axis) and the height (Y-axis); this value is multiplied by the
current values.
• Example: scale(2,3) doubles the width and triples the height.
• With the rotate() method, the element rotates clockwise at a
given degree. Negative values are allowed and rotate the element
counter-clockwise.
TRANSFORMATIONS CONTINUED
*3D is not supported at this time; check the list of browser support.
2D TRANSFORMATIONS – EXAMPLES
LECTURE Lesson 3.4
Canvas
Directions:
• Read the scenario in the In-class Activity.
• Use the resources in this presentation and your own investigative
skills to answer the questions.
• In this activity, you will add rounded borders and 2D transformation
styles to elements on an HTML page.
REVIEW Lesson 3.4
• How can the new Cascading Style Sheets 3 (CSS3) properties enable
the use of fonts that are not pre-loaded on a client PC?
• What impact does CSS3 have on the new HTML5 tags used for a
drawing canvas and SVG elements?
ADDITIONAL RESOURCES Lesson 3.4
MSDN Resources
Microsoft® Typography http://www.microsoft.com/typography/WEFT.mspx
How to Add Rounded http://msdn.microsoft.com/library/gg589503.aspx
Corners with CSS
Internet Explorer® http://msdn.microsoft.com/en-us/ie/gg593671
Learning – CSS3
Other Resources
W3 Schools CSS3 http://www.w3schools.com/css3/default.asp
Google Web Fonts http://code.google.com/webfonts
MTA EXAM 98-375
HTML5 Application Development
Fundamentals
98-375: OBJECTIVE 4
Code by Using JavaScript
LESSON 4.1
Manage and maintain
JavaScript
OVERVIEW Lesson 4.1
Directions:
• Read the scenario in the In-class Activity.
• Create an HTML5 page with JavaScript and test it in a browser.
REVIEW Lesson 4.1
MSDN Resources
JavaScript Fundamentals http://msdn.microsoft.com/en-
us/library/6974wx4d(v=VS.94).aspx
JavaScript Reference http://msdn.microsoft.com/en-
us/library/yek4tbz0(v=VS.94).aspx
Windows Library for http://msdn.microsoft.com/en-
JavaScript Reference us/library/windows/apps/br211669.aspx
Other Resources
jQuery Documentation http://docs.jquery.com/Main_Page
W3 Schools JavaScript http://www.w3schools.com/js/default.asp
Tutorial
MTA EXAM 98-375
HTML5 Application Development
Fundamentals
98-375: OBJECTIVE 4
Code by Using JavaScript
LESSON 4.2
Update the UI by using
JavaScript
OVERVIEW Lesson 4.2
• Locating/accessing elements.
• Listening to and responding to events.
• Showing and hiding elements.
• Updating the content of elements.
• Adding elements.
GUIDING QUESTIONS Lesson 4.2
Locating/Accessing Elements
• When the browser loads a new web page, it creates an outline for all
the tags on the page. This is called the Document Object Model
(DOM).
• Each tag is referred to as an element on the page.
• JavaScript finds and accesses these elements by using the element
ID field or the tag name.
• Example:
<p id=“message”>This is a special message</p>
....
var message = document.getElementById(‘message’);
• After the element is located, JavaScript can be used to add to it,
change it, or remove it from the web page.
LECTURE Lesson 4.2
Adding Elements
• Use document.createElement(sTag) to add an element to a
page.
• You must perform a second step when you use createElement to
create the input element.
– The createElement method generates an input text box by default.
What happens, if when using JavaScript to search for a tag name, there
are multiple tags with the same name?
IN-CLASS ACTIVITY Lesson 4.2
Directions:
• Read the scenario in the In-class Activity.
• Create an HTML5 page that includes JavaScript that responds to
events.
REVIEW Lesson 4.2
MSDN Resources
JavaScript Language http://msdn.microsoft.com/en-
Reference us/library/d1et7k7c(v=VS.94).aspx
JavaScript Reference http://msdn.microsoft.com/en-
us/library/windows/apps/yek4tbz0(v=vs.94).aspx
Other Resources
JavaScript Kit http://www.javascriptkit.com/javatutors/
W3 Schools JS & DOM http://www.w3schools.com/jsref/dom_obj_event.asp
Reference
Textbook: JavaScript & McFarland, D. S. (2012). JavaScript & JQuery.
jQuery Sebasopol: O'Reilly Media, Inc.
MTA EXAM 98-375
HTML5 Application Development
Fundamentals
98-375: OBJECTIVE 4
Code by Using JavaScript
LESSON 4.3
Code Animations by
Using JavaScript
OVERVIEW Lesson 4.3
Animations
• Most animations on websites are created by using JavaScript. An
animation is the illusion of movement or the appearance of motion.
• Examples of animations include:
• Scrolling banners
• Popup boxes
• Fading images or pages in and out
• Mouse-over effects
• Movement of objects
• Animation of the first page
• Image slide shows
• Counting down/up to a certain date and/or time
LECTURE Lesson 4.3
In this demonstration, you will see how to include the jQuery library
functions to create an animated effect.
DISCUSSION Lesson 4.3
Directions:
• Read the scenario in the In-class Activity.
• Use the resources mentioned in this presentation and your own
investigative skills to answer the questions.
• Part of the activity includes creating an HTML5 page that includes
animation from jQuery Library.
REVIEW Lesson 4.3
MSDN Resources
Animating your UI http://msdn.microsoft.com/en-
us/library/windows/apps/hh465165.aspx
Windows Library for http://msdn.microsoft.com/en-
JavaScript reference us/library/windows/apps/br211669.aspx
Other Resources
SourceCodeOnline - http://www.sourcecodeonline.com/sources/
JavaScript javascript.html
jQuery API http://api.jquery.com/animate/
MTA EXAM 98-375
HTML5 Application Development
Fundamentals
98-375: OBJECTIVE 4
Code by Using JavaScript
LESSON 4.4
Access Data Access by
Using JavaScript
OVERVIEW Lesson 4.4
AppCache
• Application cache (or AppCache) was introduced with HTML5 to
provide web applications access to data when the user is offline.
• The benefits of using AppCache include offline access, speed, and
reduced server dependency.
• The developer specifies the files to be included in the AppCache.
• The file is basically a text file with a list of resources that the browser
should cache for offline access.
DEMONSTRATION Lesson 4.4
How will these new features to access data access using JavaScript
change the web?
IN-CLASS ACTIVITY Lesson 4.4
Directions:
• Read the scenario in the In-class Activity.
MSDN Resources
IndexedDB http://msdn.microsoft.com/en-
us/library/hh673548(v=vs.85).aspx
File API http://msdn.microsoft.com/en-
us/library/hh673542(v=VS.85).aspx
Other Resources
JSON Tutorial http://www.w3schools.com/json/default.asp
HTML5 Rocks and File http://www.html5rocks.com/en/tutorials/file/filesyst
API em/
MTA EXAM 98-375
HTML5 Application Development
Fundamentals
98-375: OBJECTIVE 4
Code by Using JavaScript
LESSON 4.5
Respond to the Touch
Interface
OVERVIEW Lesson 4.5
• Rotation gestures
• To capture gesture events, JavaScript has a gesturestart event, and
gesturechange, gesturemove, and gestureend events. These events track the
change of the gesture.
• Each event has a numeric value representing the scale and rotation values.
• The scale property is the ratio of the current distance between two fingers to
the initial distance.
GESTURES CONTINUED
node.ongestureend = function(e){
// Update the values for the next gesture
width *= e.scale; height *= e.scale; rotation = (rotation +
e.rotation) % 360; }
DISCUSSION Lesson 4.5
What best practices should be considered during the web design phase
when creating applications for touch screen devices?
IN-CLASS ACTIVITY Lesson 4.5
Directions:
MSDN Resources
Touch Gestures http://msdn.microsoft.com/en-
(Windows® Embedded us/library/ee499124.aspx
Compact 7)
JavaScript, Ajax, & http://msdn.microsoft.com/en-us/ie/dd420501
DOM
Other Resources
Mobile Touch Events in http://davidwalsh.name/mootools-touch
MooTools 1.3
jQuery http://archive.plugins.jquery.com/plugin-
tags/gesturestart
MTA EXAM 98-375
HTML5 Application Development
Fundamentals
98-375: OBJECTIVE 4
Code by Using JavaScript
LESSON 4.6
Code Additional
HTML5 APIs
OVERVIEW Lesson 4.6
• GeoLocation
• Web Workers
• WebSockets
GUIDING QUESTIONS Lesson 4.6
• What is a WebSocket?
LECTURE Lesson 4.6
GeoLocation
• The GeoLocation API (Application Programming Interface) is
used to find the latitude and longitude of a web user.
• Uses of geolocation:
• Provide online timetables for public transportation in close
proximity to the user.
• Notify the user of school delays and closings relative to their
location.
• Find restaurants, gas stations, hotels, grocery stores.
GEOLOCATION CONTINUED
Web Worker
• Allows JavaScripts to run in the background as parallel threads.
• The developer can spawn background scripts that run
simultaneously.
• Every new worker object requires a .js file. Example:
var myWorker = new Worker(‘worker.js’);
• Allows communication between the host worker and worker
scripts. It uses postmessage and then listens for a response using
the onmessage event. Example:
WebSockets
• Provides a new JavaScript API and protocol for two-way
communication over the Internet.
• Makes it easier to work directly with fixed-data formats, and
bypasses the slower HTTP protocol.
• Allows data to be sent using text, binary arrays, or blobs
• To implement, the developer must follow these steps:
• Use a client browser that implements a WebSocket protocol
• Write code that creates a client WebSocket using a constructor
• Write code on a web server that responds to the client request
through a WebSocket
DEMONSTRATION Lesson 4.6
In this demonstration, you will see how to use the new Geolocation API
combined with Bing® Maps (requires Internet Explorer® 9 or later).
DISCUSSION Lesson 4.6
What privacy issues that can result from the use of Geolocation APIs?
IN-CLASS ACTIVITY Lesson 4.6
Directions:
• Read the scenario in the In-class Activity.
• Create an HTML5 page that employs the new HTML5 Geolocation
API to calculate the distance travelled.
REVIEW Lesson 4.6
• What is a WebSocket?
ADDITIONAL RESOURCES Lesson 4.6
MSDN Resources
Geolocation http://msdn.microsoft.com/en-
us/library/gg589499(v=vs.85).aspx
Web Workers http://msdn.microsoft.com/en-
us/library/ie/hh673568(v=vs.85).aspx
WebSockets http://msdn.microsoft.com/en-
us/library/ie/hh673567(v=vs.85).aspx
Other Resources
HTML5 Rocks - http://www.html5rocks.com/en/tutorials/geolocatio
Geolocation API n/trip_meter/
What is a WebSocket? http://websocket.org/
HTML5 Rocks – The http://www.html5rocks.com/en/tutorials/workers/b
Basics of Web Workers asics/
MTA EXAM 98-375
HTML5 Application Development
Fundamentals
98-375: OBJECTIVE 4
Code by Using JavaScript
LESSON 4.7
Access Device and
Operating System
Resources
OVERVIEW Lesson 4.7
More and more of the technology we use has the potential of allowing
predators to invade our privacy.
Directions:
• Read the scenario in the In-class Activity.
MSDN Resources
The Windows Runtime http://msdn.microsoft.com/en-
us/library/windows/apps/hh464942.aspx
Accelerometer http://msdn.microsoft.com/en-
Overview us/library/ff431810(v=vs.92).aspx
Other Resources
W3C DeviceOrientation http://dev.w3.org/geo/api/spec-source-
Event Specification orientation.html
Wikipedia: HTML5 in http://en.wikipedia.org/wiki/Html5_in_mobile_
mobile devices devices