h5怎么跳转到小程序的页面?
网上不少朋友说,先引入jweixin-1.3.0.js,然后通过wx.miniProgram.navigateTo 方法跳转到指定的小程序页面。
可是,请问,我在哪里告诉微信,我要跳转到哪个小程序里去?在哪里配置目标小程序的信息?
如果我直接
wx.miniProgram.navigateTo({
url: '/pages/index’
});
那我__跳哪个小程序__里去?哪里指定?懵逼,急求大神指点。
10 回复
<!DOCTYPE html> < html lang = "en" > < head > < meta charset = "UTF-8" > < title >Document</ title > < meta name = "viewport" content = "user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1" /> < script src = "https://res.wx.qq.com/open/js/jweixin-1.3.0.js" ></ script > </ head > < body > < div id = "app" >点我</ div > < div id = "error" ></ div > < script > var app = document.getElementById('app'); var error = document.getElementById('error'); app.onclick = function() { wx.miniProgram.navigateTo({ path: '/pages/index', appId: '===================', success: function() { error.innerText = "success"; }, error: function(err) { error.innerText = err; } }); }; </ script > </ body > </ html > |