我想,我会架一支鱼竿,独钓岁月那一边的故事。

js url截取参数

function getParam(href){
    href = href?href.split('?')[1]:window.location.search.slice(1);
    if(href){
        var param = {};
        $.each(href.split('&'),function(i,n){
            param[n.split('=')[0]] = n.split('=')[1];
        });
        return param;
    }
    return '';
}
undefined
href = window.location.href;

getParam(href);
Object {platform: "", plattype: "1,2", status: "3,4", orshow: "", datetime: ""…}