jquery获取url参数

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