Users Pricing

forum

home / developersection / forums / javascript - get portion of url path

JavaScript - Get Portion of URL Path

Royce Roy 3387 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


Royce Roy

Other


1 Answers