日期:2014-05-16  浏览次数:20363 次

js获得地址栏参数值
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title></title>
</head>
<body>
<script language="javascript">
    function getParmValue(item) {
        var svalue = location.search.match(new RegExp("[\?\&]" + item + "=([^\&]*)(\&?)", "i"));
        return svalue ? svalue[1] : svalue;
    }
    var param1_value = getParmValue("param1");
    alert("param1=" + param1_value);
</script>
</body>
</html>


地址栏输入:http://liuwentao2011:8080/cooperate/loading.html?param1=liuwentao

结果: