The document discusses HTML5 and its APIs. It provides an overview of several HTML5 APIs including the geolocation API, web storage API, web workers API, and WebSocket API. It also discusses how these new HTML5 features allow for more advanced web applications compared to older technologies like Flash. Finally, it mentions some libraries and tools for testing HTML5 browser support.
43. Geolocation API
•
• IP GPS
function callback(position) {
lat = position.coords.latitude;
....
}
navigator.geolocation.getCurrentPosition(callback);
45. Web Workers API
• JavaScript API
• DOM
main.js
var worker = new Worker(“calc.js”);
worker.onmessage = function(event) { alert(event.data); };
worker.postMessage(100);
calc.js
onmessage = function(event) {
var num = event.data.num;
for (var i = 0; i < 10000; i++) { num = num + i; }
postMessage(num);
};