Javascript 在jquery/JS中获取uri LocalPath?
用一个简单的问题解决一个简单的问题。我有一个字符串,在C语言中,我可以通过uri访问LocalPath 如何在jquery或javascript中获取LocalPath?(本地路径:“/asas”) {} 嗯,在浏览器中,“window.location”对象有一个“pathname”属性,这(我想)就是你想要的。“协议”、“主机”、“端口”等还有其他属性: 现在,这是您正在使用的页面的本地路径;换句话说,这不是一种获取空间中任何旧URL的本地路径的通用方法Javascript 在jquery/JS中获取uri LocalPath?,javascript,jquery,Javascript,Jquery,用一个简单的问题解决一个简单的问题。我有一个字符串,在C语言中,我可以通过uri访问LocalPath 如何在jquery或javascript中获取LocalPath?(本地路径:“/asas”) {} 嗯,在浏览器中,“window.location”对象有一个“pathname”属性,这(我想)就是你想要的。“协议”、“主机”、“端口”等还有其他属性: 现在,这是您正在使用的页面的本地路径;换句话说,这不是一种获取空间中任何旧URL的本地路径的通用方法 AbsolutePath: "/as
AbsolutePath: "/asas"
AbsoluteUri: "http://z.com/asas?sadfdsgfg"
Authority: "z.com"
DnsSafeHost: "z.com"
Fragment: ""
Host: "z.com"
HostNameType: Dns
IsAbsoluteUri: true
IsDefaultPort: true
IsFile: false
IsLoopback: false
IsUnc: false
LocalPath: "/asas"
OriginalString: "http://z.com/asas?sadfdsgfg"
PathAndQuery: "/asas?sadfdsgfg"
Port: 80
Query: "?sadfdsgfg"
Scheme: "http"
Segments: {string[2]}
UserEscaped: false
UserInfo: ""