Skip to content

Instantly share code, notes, and snippets.

@yahelc
Created May 9, 2012 19:03
Show Gist options
  • Save yahelc/2648038 to your computer and use it in GitHub Desktop.
Save yahelc/2648038 to your computer and use it in GitHub Desktop.
redirect url js
var get = (function() {
var map = {};
location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m, k, v) {
map[k] = v;
});
return map;
} ());
$("input[name='redirect_url']").val(get.redirect_url);
@imjared
Copy link

imjared commented Feb 27, 2014

what are m,k,v?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment