Capture value out of query string with regex?
/name=([^&]*)/ remove the ^ and end with an & Example: var str = “/pages/new?name=J&return_url=/page/new”; var matches = str.match(/name=([^&]*)/); alert(matches[1]); The better way is to break all the params down (Example using current address): function getParams (str) { var queryString = str || window.location.search || ”; var keyValPairs = []; var params = {}; queryString = … Read more