url参数的获取

方法

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

应用

URL

输出

原文地址:https://www.cnblogs.com/excellencesy/p/9560832.html