once - Methods - Questions API

Questions API Methods

once()

Just like on, but causes the bound callback to only fire once before being moved. Handy for saying "the next time that X happens, do this".

Arguments

  • eventName string

    Name of the event that you want to stop listening to

  • eventCallback callback

    If no callback is provided, all event handlers for the eventName will be removed.

  • context object

    If no context is provided, all event bindings for the eventName, eventCallback combination will be removed

Return value

None (undefined).

Was this article helpful?

Did you arrive here by accident? If so, learn more about Learnosity.