开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜