
Web API?
It's a bit ambiguous to say Web API
as there are two kinds:
Right now, we're concerned about the former. Next week we'll do the latter.
...and many, many more.
You can read a full list on the W3C website status page.
Take a look at the Geolocation API Specification
[NoInterfaceObject]
interface NavigatorGeolocation {
readonly attribute Geolocation geolocation;
};
Navigator implements NavigatorGeolocation;
So, window.navigator.geolocation is your starting point:
[NoInterfaceObject]
interface Geolocation {
void getCurrentPosition(PositionCallback successCallback,
optional PositionErrorCallback errorCallback,
optional PositionOptions options);
long watchPosition(PositionCallback successCallback,
optional PositionErrorCallback errorCallback,
optional PositionOptions options);
void clearWatch(long watchId);
};
Note: We will talk about callbacks next time.
function sayIt() {
var u = new SpeechSynthesisUtterance(
'Hello, Veronika! ' +
'Would you like to see a picture of a kitty cat?');
speechSynthesis.speak(u);
}
(and a good way to entertain a 2-year-old whilst making slides)
A more interesting .