Page FAQ

Q: How to use cookie in Mini Program

A: Cookie is not suggested to be used in Mini Program, the cookie set by server side will not be forbidden and it will be set to the Mini Program process. In the next request, the cookie will be set into the request automatically. In front side, cookie can not be obtained and will do nothing about the cookie.

Q: How to get the parameters of onload in certain page

A: From getCurrentPages, the instance of page stack can be obtained, then parameters can be obtained.

Q: Can Mini Program able to listen to the close event? Which function will be invoked when clicking the close button?

A: Mini Program can not listen to the close event and nothing will be invoked when clicking the close button.

Q: Data does not refresh when calling setData

A: Please check the effectiveness of this instance and make sure the code logic is correct.

Q: Blank page displays when jumping to a new page, how to solve it

A: If using request to get data from server side, please make sure the domain whitelist is configured. If not, the data can not be requested, which may causing blank page.

Q: How to get the parameter in the link when jumping to a new page

A: Use onLaunch to listen to the initialization of Mini Program, the query can be obtained from the onLaunch parameter.

Q: How to import js in Mini Program

A: Use import {Ajax} from '/util(or ./util)' to import js

Q: How to trigger a function automatically without clicking

A: Call the function in onload or onshow.