获取从链接传来的id

<!-- 获取id -->
<script type="text/javascript">
var id=getQueryString('id');
function getQueryString(id) {
var reg = new RegExp("(^|&)" + id + "=([^&]*)(&|$)", "i");
var r = decodeURI(window.location.search).substr(1).match(reg);
if(r != null) return (r[2]);
return null;
}

</script>

posted on 2021-01-24 11:31  bigbig钊  阅读(214)  评论(0编辑  收藏  举报