Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 22nd, 2012  |  syntax: None  |  size: 0.47 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. }