<!– 示例代码 –>
<a href=”weixin://dl/business/?appid=wx9ca33b529b349d78&path=diy%2Fpages%2Findex&env_version=release” class=”open-btn”>
点击打开小程序
</a>
<script>
// 可以添加点击事件,提示用户会跳转到微信
document.querySelector(‘.open-btn’).addEventListener(‘click’, function(e) {
if (!isWeChatBrowser()) {
confirm(‘即将打开微信应用,是否继续?’);
}
});
</script>

