JSON.parse(str)
			
JSON.stringify(json)
			
			| 假设当前链接为http://127.0.0.1:8080/login.html?id=1#abc | |||
|---|---|---|---|
| js代码为:window.location.{属性} | |||
| 属性 | 说明 | 代码 | 获取结果 | 
| href | 完整的URL | window.location.href | http://127.0.0.1:8080/login.html?id=1#abc | 
| protocol | 协议 | window.location.protocol | http: | 
| hostname | 主机名 | window.location.hostname | 127.0.0.1 | 
| host | 主机名加端口号 | window.location.host | 127.0.0.1:8080 | 
| port | 端口号 | window.location.port | 8080 | 
| pathname | 当前URL的路径部分 | window.location.pathname | /login.html | 
| search | URL的查询部分 | window.location.search | ?id=1 | 
| hash | #开始的锚 | window.location.hash | #abc |