1. function getUrlParam(name) {
    2. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
    3. var r = window.location.search.substr(1).match(reg); //匹配目标参数
    4. if (r != null) return unescape(r[2]); return null; //返回参数值
    5. }
    6. var sources = getUrlParam('s')
    7. var stypes = getUrlParam('style')