Small program development pits-different uses of onload and onshow

Small program development pits-different uses of onload and onshow

Difference: (When the page returns to the previous page, change some display states)

The day before yesterday the applet encountered a problem: if it is the first time to load after closing the applet, when it is in the billing state, it will jump to the billing interface by default;

If you return from the charging interface, you need to display the current charging status after returning. If you put the code that controls the display status in onload,

The back button will not trigger the update state, so you need to put the code inside onshow,

Every time the page is loaded, the current status will be queried. If it is the current page returned, the prompt message "Billing needs to be redirected" will be displayed on the current page. Click to jump to the charging interface

Guess you like

Origin www.cnblogs.com/homehtml/p/12692992.html