A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/en-US/docs/Web/API/Sensor/activate_event below:

Sensor: activate event - Web APIs

Sensor: activate event

Limited availability

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

The activate event is fired when a sensor becomes activated. It means that it will start obtaining readings.

The Sensor interface is a base class, onactivate and the activate event may only be used on one of the derived classes.

Syntax

Use the event name in methods like addEventListener(), or set an event handler property.

addEventListener("activate", (event) => { })

onactivate = (event) => { }
Event type

A generic Event with no added properties.

Examples Log when an accelerometer is ready to measure

This example adds an event listener to log the activation of an Accelerometer.

const acl = new Accelerometer({ frequency: 60 });
acl.addEventListener("activate", () => console.log("Ready to measure."));
acl.start();
Specifications Browser compatibility See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4