Rob Morris
Rob Morris

Reputation: 533

Get search path of URL with jQuery

I have the following URL which is generated from a search:

http://example.com/wwn/en/resources/?search_paths[]=/wwn/en/resources&resource-category=Welsh+Wound+Network

I've read about using window.location.search but how can i use this with the above url. Basically I need to get the result of 'resource-category' which in this case is Welsh Wound Network

Upvotes: 0

Views: 110

Answers (1)

AMaitra
AMaitra

Reputation: 36

You can try this way too: http://code-tricks.com/get-url-parameters-using-javascript/

In your case, you can use the function in the above url and do: var resourceCategoryParameter = getUrlParameters("resource-category", "", true);

This should return whatever is in resource-category.

Upvotes: 1

Related Questions