js取url参数

 function GetQueryString(name)
    {
        var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if(r!=null)return  unescape(r[2]); return null;
    }

var my_income_price = GetQueryString("totalMoney");

 

posted @ 2016-12-23 12:00  Cynthia娆墨旧染  阅读(146)  评论(0编辑  收藏  举报