Possible Duplicate:
How to parse a URL?
I'm using the jQuery address plugin and I want to know what the preferred method is for parsing URLs in JavaScript. Should I use a regex for each URL, or is there a better way?
As an example, one of my urls looks like this from my address change event:
/visits=10
My existing address change event simply displays the URL that was changed.
// Handle handle change events
$.address.change(function(e) {
alert(e.value);
// Call the correct page based on the page number
});
Any ideas or suggestions?