Wx. Config ({
The debug: true,//open the debug mode, all the API calls return values will alert on the client, if you want to check the incoming parameters, can open the PC, parameter information through the log to type, only when the PC will print,
AppId: data appId,//required, the public, the unique identification of the
Timestamp, the data. The timestamp,//required, the signature of timestamp
NonceStr: data nonceStr,//required, the signature of a random string
Signature: data signature,//will fill, sign, see appendix 1
JsApiList: [' closeWindow ']//required, you need to use JS interface list, list all JS interface see appendix 2
});
Wx. Ready (function () {
//config information will execute ready after verification method, all interface call must be after the config interface to get the results, the config is an asynchronous operation on the client side, so if you need to call when the page loads related interfaces, must put the related interface call ready function to ensure the correct implementation, trigger to call interface for the users, you can call directly, do not need to put in the ready function,
The console. The log (' call success);
});
Wx. Error (function (res) {
//config information authentication failure can perform error function, such as signature date cause validation fails, a specific error message to open the config the debug mode view, can also see in return res parameters, for SPA can update signature here,
console.log(res);
});
The function back () {
Alert (" close ");
Wx. CloseWindow ();
}
CodePudding user response:
After I did a button click in the page will start back method but wx. CloseWindow does not perform, don't know is what reason, written in WeChat developer debugging tools found in wx. No execution in the ready, but without an error, look at the console that should be verified through, recently learning WeChat web development, may the great god to answerCodePudding user response:
Can have a timer, configured start time, if a period of time did not trigger the wx ready on the performance of the timerCodePudding user response:
There are a great god readyCodePudding user response:
I change a day, ready to onl oad,CodePudding user response:
Bosses, the configuration, I didn't don't work, I ask you how to configure