How to easily dissect a link with javascript?

Mathushan

New Member
How would I go about dissecting a link/href with Javascript or JQuery?I can use split to split some of the variables up, but I was wondering if there is an easier way to go about this, for example...www.url.com/dir/page?setting&var1=value1What would be the easiest way to get dir, page, and setting.P.S. It would be nice to always select the last directory, so using a standard split won't always work if there are multiple directories.
 
Back
Top