微信 小程序 require
发表于|更新于|wxapp
经过测试和阅读可以知道
小程序的require加载js实际上只会加载 执行了一次
参考
文章作者: developer
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 Dev!
相关推荐
2017-08-21
egret h5 IOS 移动端 微信 自动播放声音
解决方法1234567891011121314function playsound(sound:egret.Sound,loop:boolean= false){ if(sound == null){ console.log('sound err') return; } var times = loop?0:1; if(typeof WeixinJSBridge != 'undefined'){ WeixinJSBridge.invoke('getNetworkType', {}, function (e) { return sound.play(0,times); }); }else{ return sound.play(0,times); }} 方法原理因为IOS有个先交互再播放声音的要求,而微信上借助WeixinJSBridge 可以做很多事情,通过他播放声音即可
2018-05-23
微信 alert 禁止 显示 地址 url
12345678window.alert = function (name) { var iframe = document.createElement("IFRAME"); iframe.style.display = "none"; iframe.setAttribute("src", 'data:text/plain,'); document.documentElement.appendChild(iframe); window.frames[0].window.alert(name); iframe.parentNode.removeChild(iframe);};
2018-07-10
小程序 解密 敏感信息后得到的数据
数据结构 1234567891011array( 'openId' => 'openId-openId', 'unionId' => 'unionId_unionId', 'nickName' => '_Merlin.', 'gender' => 2, 'language' => 'zh_CN', 'city' => '', 'province' => '上海', 'country' => '中国', 'avatarUrl' => "https://wx.qlogo.cn/mmopen/vi_32/PiajxSqB...
2018-01-10
微信 开放平台 第三方平台 授权
具体流程可以查看http://blog.csdn.net/qq1021623362/article/details/44922831或者官方文档 官方文档中说authorizer_refresh_token丢失后,只会在授权时刻提供,请妥善保存。 一旦丢失,只能让用户重新授权,才能再次拿到新的刷新令牌 实际上并不是这样 微信会每隔10分钟推送一次component_verify_ticket 使用component_appid component_appsecret component_verify_ticket可以换取component_access_token 使用component_appid authorizer_appid
2018-10-20
laya layaair webaudio h5 ios 微信 电流声 爆音 滋滋声 解决办法
经过大量测试使用layaair开发的H5经常遇到IOS声音异常的问题,也不是全部设备 原因在调用Laya.init时,引擎也顺便初始化了webaudio,并且不能关闭,到最新的1.7.20版本,声音的问题尚未修复即使调用Laya.SoundManager.useAudioMusic = true 使用声音标签播放,依然有这个问题而且webaudio也无法关闭 只要new了webaudio,那些ios设备就一定会出现爆音 解决办法在初始化之前,删除webaudio对象 1window.AudioContext= window.AudioContext=window.webkitAudioContext = window.mozAudioContext = null
2018-07-01
小程序 setData 修改 对象 数组 不生效
有两种修改方法 推荐可以在属性价格符号 12345let s = thislet indexName = 'nowque.error's.setData({ [indexName]: err,}) 方法二先读出修改再赋值 1234let data = this.data.data;data.id="123"data[i].id="123";this.setData({data:data});
公告
This is my Blog