Advertisement
Guest User

Untitled

a guest
Sep 21st, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. /*
  2. * Value from location search
  3. */
  4. var regex = /[?&]([^=#]+)=([^&#]*)/g,
  5. url = window.location.href,
  6. params = {};
  7. while(match = regex.exec(url)) {
  8. params[match[1]] = match[2];
  9. }
  10.  
  11. console.log([params]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement