复制代码 代码如下:
<script type="text/javascript">
String.prototype.getQuery = function(name){
var reg = new RegExp('(^|\\?|&)'+name+'=([^&]*|$)'), url = this.replace(/&/g, '&'), r = url.match(reg);
return r === null ? null : unescape(r[2]);
}
var str = 'http://wpa.qq.com/msgrd?v=3&uin=1438344583&site=qq&menu=yes';
alert(str.getQuery('uin'));
</script>
时间: 2024-12-22 16:26:53