Advertisement
MertcanGokgoz

urlparse

Dec 30th, 2018
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function getUrlVars() {
  2.     var vars = [], hash;
  3.     var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
  4.     for (var i = 0; i < hashes.length; i++) {
  5.         hash = hashes[i].split('=');
  6.         vars.push(hash[0]);
  7.         vars[hash[0]] = hash[1];
  8.     }
  9.     return vars;
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement