Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

MozNFC.onpeerfound

Non-standard
This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

The onpeerfound event handler of the MozNFC interface is called when a MozNFCPeer is detected.

The application has to be running on the foreground (decided by System app) to receive this event.

The default action of this event is to dispatch the event in System app again, and System app will run the default UX behavior (like vibration). So if the application would like to cancel the event, the application should call event.preventDefault() or return false in this event handler.

Syntax

attribute EventHandler onpeerfound;

Properties

peer : The NFCPeer object.

Document Tags and Contributors

 Contributors to this page: chrisdavidmills, lgarner, teoli, kscarfone, allstars.chh
 Last updated by: chrisdavidmills,