Get query string in the foreground

From , 5 Years ago, written in JavaScript, viewed 72 times.
URL https://pastebin.vip/view/a666587a
  1.         function getArgs(strParame) {
  2.             var args = new Object();
  3.             var query = location.search.substring(1); // Get query string
  4.             var pairs = query.split("&"); // Break at ampersand
  5.             for (var i = 0; i < pairs.length; i++) {
  6.                 var pos = pairs[i].indexOf('='); // Look for "name=value"
  7.                 if (pos == -1) continue; // If not found, skip
  8.                 var argname = pairs[i].substring(0, pos); // Extract the name
  9.                 var value = pairs[i].substring(pos + 1); // Extract the value
  10.                 value = decodeURIComponent(value); // Decode it, if needed
  11.                 args[argname] = value; // Store as a property
  12.             }
  13.             return args[strParame]; // Return the object
  14.         }

Reply to "Get query string in the foreground"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website