Learning Note 3 (get the version number), Learning note version number
Because the old version is still in use, the old version of jssdk is different from the new version, you need to determine that the version uses different js APIs
I checked it online. There are two methods to determine a better version:
1. js-based judgment
Var wechatInfo = navigator. userAgent. match (/MicroMessenger \/([\ d \.] +)/I); if (! WechatInfo) {alert ("this activity only supports");} else if (wechatInfo [1] <"5.0 ") {alert ("this activity only supports version 5.0 and later ");}
Original Forum address:
Http://segmentfault.com/q/1010000002536116
2. Use php code to determine
$ Explorer = explode ('micromessenger/', $ _ SERVER ['HTTP _ USER_AGENT']); $ version = str_replace ('. ', '', substr ($ explorer [1], 100); if ($ version <) {$ version = $ version * 10 ;} // determine whether the version is later than or equal to 6.0if ($ version> = 600) {// your code here ...} else {// your code here ...}