getUrlParam(name) {
var url = decodeURI(weex.config.bundleUrl); //取得整个地址栏
var result = url.match(new RegExp("[\?\&]" + name + "=([^\&]+)", "i"));
if (result == null || result === undefined) {
console.warn( '警告:\n--- start :\n' + name + ' 值为 ' + result + '\n--- end \n\n');
}else{
return result[1];
}
}
本文介绍了一种使用Weex框架获取URL参数的方法。通过解码URL并应用正则表达式匹配来提取特定参数值。如果找到匹配项,则返回该值;如果没有找到,则发出警告。

2664

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



