Users Pricing

forum

Home Forums JavaScript - Get Portion of URL Path – MindStick

JavaScript - Get Portion of URL Path

Royce Roy 3451 12 Mar 2013

Hi Everyone!

What is the correct way to pull out just the path from a URL using JavaScript?

Example:
I have URL
http://www.somedomain.com/account/search?filter=a#top
but I would just like to get this portion
/account/search

I am using jQuery if there is anything there that can be leveraged.

Thanks in advance


1 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md