Professional Documents
Culture Documents
HTML Charset : Definire: Encoding: What's New!!!
HTML Charset : Definire: Encoding: What's New!!!
<aside>
<dialog>
<figcaption>
<figure>
<footer>
<header>
<nav>
<section>
color
date
datetime
datetime-local
email
month
number
range
search
tel
time
url
week
autocomplete
autofocus
form
formaction
formenctype
formmethod
formnovalidate
formtarget
height and width
list
min and max
multiple
pattern (regexp)
placeholder
required
step
HTML5 Semantics
A semantic element clearly describes its meaning to both the browser and the developer.
Examples of non-semantic elements: <div> and <span> - Tells nothing about its content.
Examples of semantic elements: <form>, <table>, and <img> - Clearly defines its content.
With HTML5 elements like: <header> <footer> <nav> <section> <article>, this will become
easier for search engines to identify the correct web page content.
HTML5 API
1. HTML5 Geolocation
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
} else {
browser.";
Main idea is to use getCurrentPosition() in order to get the position. You can pass a parameter
in the callback in order to be called when position is gathered with success.
Callback needs to be have a parameter called position -> there will be stored the position
(coordinates).
Position attributes :
Property
Description
coords.latitude
coords.longitude
coords.accuracy
coords.altitude
coords.altitudeAccuracy
coords.heading
coords.speed
timestamp
closed)
// Store
localStorage.lastname = "Smith";
// Retrieve
document.getElementById("result").innerHTML = localStorage.lastname;
4. HTML5 Caching
Application cache gives an application three advantages:
1. Offline browsing - users can use the application when they're offline
2. Speed - cached resources load faster
3. Reduced server load - the browser will only download updated/changed
resources from the server
<!DOCTYPE HTML>
<html manifest="demo.appcache">
File demo.appcache is explained below :
The manifest file has three sections:
CACHE MANIFEST - Files listed under this header will be cached after they are
downloaded for the first time
NETWORK - Files listed under this header require a connection to the server,
and will never be cached
FALLBACK - Files listed under this header specifies fallback pages if a page is
inaccessible
CACHE MANIFEST
The first line, CACHE MANIFEST, is required:
CACHE MANIFEST
/theme.css
/logo.gif
/main.js
Updating the Cache
Once an application is cached, it remains cached until one of the following happens: