Learn HTML5 - Part 4

Опубликовано: 21 Март 2025
на канале: WEBoLOGY. in
19
0

Presented by: Aakash Biswas

Duration: 3.22 minutes

Watch HTML5 Part 1:    • Learn HTML 5  - Part 1  
Watch HTML5 Part 2:    • Learn HTML5 -  Part 2  
Watch HTML5 Part 3:    • Learn HTML5 - Part 3  

Geolocation
The Geolocation API is used to get the geographical position of a user.
The getCurrentPosition method is used to return the user's position.
To see the result you need to have access to Google Maps or some other service.

Drag and Drop
Drag and drop is part of the standard by which, any element can be draggable and dropped on the web page.

Web Storage
Using web storage web applications can store data locally within the user's browser.
Before HTML5, application data had to be stored in cookies, included in every server request. But with web storage it is more secure, and large amounts of data can be stored locally, without affecting the websites performance.
But unlike cookies, the storage limit is far larger which is at least 5MB and information is never transferred to the server.
Web storage is per origin, per domain and protocol. All pages, from one origin, can store and access the same data.
Web storage provides two objects for storing data on the client:

1)window.localStorage - stores data with no expiration date

2)window.sessionStorage - stores data for one session, so the data is lost when the browser tab is closed


Web Workers
When you execute scripts in an HTML page, the page becomes unresponsive until the script is finished.
A web worker is a JS program that runs in the background, independently of other scripts, without affecting the performance of the page.


Server-Sent Events
A server-sent event is when a web page automatically gets updates from a server.