# wx.onPageNotFound(function callback)

Start from base library version 2.1.2. Please remaining backward compatible.

with Promise style call: Not supported

Mini Program plugin: Not supported

There are no events on the page that the listening Mini Program wants to open. This event is related to App.onPageNotFound The timing of the pullback was consistent.

# parameter

# function callback

The callback function for the page that the Mini Program opens does not exist

# parameter

# Object res
attribute type Introductions
path string No path to the page (Code packet path)
query Object Open a page that does not exist query parameter
isEntryPage boolean Is the first page of this launch (for example, from the Share entrance, the first is the developer configuration share page)

# Be careful

  • Developers can do page redirection in callbacks, but only in callbacksynchronizationProcessing, asynchronous processing such as setTimeout Asynchronous execution) is invalid.
  • If the developer does not call wx.onPageNotFound Binding listening, no declaration App.onPageNotFound, When the jump page does not exist, will push the WeChat client native page there is no prompt page.
  • If the callback is redirected to another page that does not exist, the original page of WeChat client will be pushed into the page that is not there and there will be no second callback.