manman89

JAVASCRIPT - GET URL VARS FUNCTION

Nov 14th, 2012
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function GET_Url_Vars(){
  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