这是一个创建于 4073 天前的主题,其中的信息可能已经有所发展或是发生改变。
queryString = function (fieldName) {
var urlString = document.location.search||'';
var r=new RegExp('(&|\\?)'+fieldName+'=(.*?)(&|$)');
return urlString.match(r)?decodeURIComponent(urlString.match(r)[2]):null;
}
3 条回复 • 1970-01-01 08:00:00 +08:00
![explon](https://cdn.v2ex.com/avatar/6da9/003b/230_normal.png?m=1705560164) |
|
1
explon 2013-05-06 16:13:19 +08:00
为什么使用 hash
|
![explon](https://cdn.v2ex.com/avatar/6da9/003b/230_normal.png?m=1705560164) |
|
2
explon 2013-05-06 16:13:41 +08:00 1
(!修正)为什么不使用 hash
|
![fishg](https://cdn.v2ex.com/gravatar/af47409d8706c0981414a406e131a24f?s=48&d=retro) |
|
3
fishg 2013-05-06 16:15:38 +08:00
用不用hash是另外一回事了吧
|