传值
需要跳转到下一个页面,在传值的时候,打算传递过去的值也有问号,如果不进行处理,在下一个页面只会取到问好前面的内容;
var href="https://www.baidu.com?test=1" //测试名字
href =encodeURIComponent(newAction.val);
wx.navigateTo({
url: '../advertising/advertising?href='+href,
})
需要使用encodeURIComponent进行编码
取值
在此页面接口他的值;并且进行转义;
onLoad: function (options) {
console.log(decodeURIComponent(options.href))
this.setData({
href:decodeURIComponent(options.href)
})
}
需要使用decodeURIComponent进行解码
219



被折叠的 条评论
为什么被折叠?



