Guest User

Untitled

a guest
Jan 14th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. function(){
  2. a=location.search; // Get the current query string of the window
  3. b=a.substring(1); // Remove the '?'
  4. c=b.split("&"); // Split the query string into separate variables
  5. f=[]; // Create the array to hold the query string variables
  6. for(d in c){ // Loop through the variables
  7. e=c[d].split("="); // Split the variables into key => value
  8. f[e[0]]=e[1]; // Add the key and value to our array
  9. }
  10. return f; // Return the array when all variables have been looped
  11. }
Add Comment
Please, Sign In to add comment