A RetroSearch Logo

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

Search Query:

Showing content from https://developer.cdn.mozilla.net/en-US/docs/Web/API/NDEFReader/readingerror_event below:

NDEFReader: readingerror event - Web APIs

NDEFReader: readingerror event

Limited availability

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

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The readingerror event of the NDEFReader interface is fired whenever an error occurs during reading of NFC tags, e.g., when tags leave the reader's magnetic induction field.

Syntax

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

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

onreadingerror = (event) => { }
Event type

A generic Event.

Examples

The following example shows how to process events using both the onreading and onreadingerror event handlers.

const ndef = new NDEFReader();
ndef
  .scan()
  .then(() => {
    console.log("Scan started successfully.");
    ndef.onreadingerror = (event) => {
      console.log(
        "Error! Cannot read data from the NFC tag. Try a different one?",
      );
    };
    ndef.onreading = (event) => {
      console.log("NDEF message read.");
    };
  })
  .catch((error) => {
    console.log(`Error! Scan failed to start: ${error}.`);
  });
Specifications Browser compatibility

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