开发者

Use javascript to parse URL (not querystring) folder structure domain/parseThis/

开发者 https://www.devze.com 2023-04-01 05:25 出处:网络
I know how to parse the query string but I am getting sent a format of :domainName/variable/somethingElseIDontCareAbout

I know how to parse the query string but I am getting sent a format of : domainName/variable/somethingElseIDontCareAbout

I need to grab that middle port开发者_如何学运维ion and so I can see what it says... any help?

Thanks! Todd


If your original url is something like http://domainname.com/variable/else, you can use this:

document.location.href.split("/")[3]

If not, just change the number in the brackets.

0

精彩评论

暂无评论...
验证码 换一张
取 消