UNPKG

@bizcharts/scaffold-cira-crowd

Version:

人群画像分析

21 lines (18 loc) 547 B
module.exports = { /** * 获取 url 中某个 query 参数 * @param {String} sParam 获取哪个参数 */ getUrlParameter(sParam) { const sPageURL = decodeURIComponent(window.location.search.substring(1)); const sURLVariables = sPageURL.split('&'); let sParameterName; let i; for (i = 0; i < sURLVariables.length; i++) { sParameterName = sURLVariables[i].split('='); if (sParameterName[0] === sParam) { return sParameterName[1] === undefined ? true : sParameterName[1]; } } }, };