Saturday, 3 December 2016

HTML 5 Basics

New Features in Html 5 -

1.<audio>           -To play audio file directly.
2.<canvas>         -To draw graphics/canvas.
3.<article>          -To display document/article/magazine
4.<video>           -To play video file directly.
5.<svg>               -To display shapes
6.<nav>               -To show navigation link
7.<section>          -To define section in document.
8.<Footer>           -To define section inside a footer.
9.<Header>          -To define header inside Section
10.<dialog>          -To show window/dialog directly
11.<progress>       -To show progress bar.

12. Local Storage - Alternative to Cookies. 

All above is shown inside DOM document .

What is <!DOCTYPE html>  ?
It is mandatory to convey browser t. hat this is HTML 5 document.
If <!DOCTYPE html> is not mentioned, will not make HTML 5 tags function properly. Im[

Validation  Update -
1.required field is used in input tags for form validation.
Eg.     Name: <input type="text" name="name" required>

2. new <input> type -> email
Eg.    <input type="email">

What is Local Storage ?
Its an alternative to Browser Cookies.
           With local Storage, Web application can store data locally within user's Browser.
Before HTML5, application data had to be stored in cookies, included in every server request.

Advantages -
1.More secure than cookies.
Because Cookies is sent with all the future HTTP request to the server,
But Local-storage data resides with browser only.It is never sent to Server with HTTP request. 

2.Hold more data than cookies(upto 4KB) without compromising web application performance.(> 5 MB)
Local storage is per origin (per domain and protocol). All pages, from one origin, can store and access the same data.


Local Storage is Global Object.
It can be accessed as below -
window.localStorage 
 
 

No comments:

Post a Comment