Function: getLocationHrefParam
getLocationHrefParam(name
): string
| null
获取URL中指定参数的值
Parameters
Name |
Type |
Description |
name |
string |
要获取的参数名称 |
Returns
string
| null
Description
从当前页面的URL中解析出指定参数的值,支持查询参数(?)、哈希参数(#)和锚点参数(&)
Throws
Example
// 假设当前URL为: http://www.example.com/?id=123&name=test
getLocationHrefParam('id'); // => "123"
getLocationHrefParam('name'); // => "test"
getLocationHrefParam('none'); // => null