Javascript获取地址栏参数

代码如下:
function getParameterByName(name) {
 
    var match = RegExp('[?&]' + name + '=([^&]*)')
                    .exec(window.location.search);
 
    return match ?
        decodeURIComponent(match[1].replace(/\+/g, ' '))
        : null;
 
}
posted @ 2011-03-08 15:12  T#S  阅读(218)  评论(0编辑  收藏  举报