webview打开H5,wx.miniProgram.navigateTo无效
发布于 6 年前 作者 ping16 6256 次浏览 来自 问答

小程序代码

<web-view src=https://xxxxxx.com#wechat_redirect”></web-view>

webview打开的H5页面。

点击调用方法是没有任何反应的,看别人都是直接可以的,求解

<a href=“javascript:;” onclick=“goHref()”>

<script type=“text/javascript” src=“https://res.wx.qq.com/open/js/jweixin-1.3.2.js”></script>

<script>

// 跳转到小程序的一个页面

goHref=function(){

                wx.miniProgram.navigateTo({

                    url: ‘/pages/login/login’,

                    success: function(){

                        alert(‘success’)

                    },

                    fail: function(){

                        alert(‘fail’);

                    },

                    complete:function(){

                        alert(‘complete’);

                    }

                })

}

</script>

1 回复

麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)

回到顶部