
A collection of the String Object prototype methods.
Turns a querystring into an object of key/value pairs.
myString.parseQueryString(decodeKeys, decodeValues);
"apple=red&lemon=yellow".parseQueryString(); //returns { apple: "red", lemon: "yellow } var fruits = "apple=red&lemon=yellow".parseQueryString(); //returns fruits.apple > "red"
Removes from a query string any keys that have empty values.
myQueryString.cleanQueryString([method]);
var cleaned = "a=b&x=&z=123&e=".cleanQueryString(); //cleaned = "a=b&z=123" var noNumberValues = "a=b&x=y&z=123&e=".cleanQueryString(function(set){ //set is "a=b", "x=y", "z=123", "e=" return !set.split("=")[1].match(/[0-9]/); }); //noNumberValues = "a=b&x=y&e="
© Linux.ria.ua, 2008-2024 |