{"_id":"jquery-query-object","_rev":"4-237b2ac5d65e107fd33bfa9f73d869ce","name":"jquery-query-object","description":"Query String Modification and Creation for jQuery","dist-tags":{"latest":"2.2.3"},"versions":{"2.2.2":{"name":"jquery-query-object","title":"Query String Modification and Creation for jQuery","description":"Query String Modification and Creation for jQuery","keywords":["query","parameter","window.location.search","querystring","deserialize","serialize"],"version":"2.2.2","author":{"name":"Blair Mitchelmore","email":"blair.mitchelmore@gmail.com","url":"https://github.com/blairmitchelmore"},"licenses":[{"type":"WTFPL","url":"http://sam.zoy.org/wtfpl/"}],"bugs":{"url":"https://github.com/alrusdi/jquery-plugin-query-object/issues"},"homepage":"https://github.com/alrusdi/jquery-plugin-query-object","docs":"https://github.com/alrusdi/jquery-plugin-query-object","download":"https://github.com/alrusdi/jquery-plugin-query-object/archive/master.zip","dependencies":{"jquery":">=1.4"},"maintainers":[{"name":"alrusdi","email":"alrusdi@gmail.com"}],"main":"jquery.query-object.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/alrusdi/jquery-plugin-query-object.git"},"license":"ISC","gitHead":"58fdbb09c962a73ef9acc31ae428187d3661605c","_id":"jquery-query-object@2.2.2","_shasum":"9f82fe29e8e3035f11badb075173defdbe913e34","_from":".","_npmVersion":"2.7.5","_nodeVersion":"0.10.25","_npmUser":{"name":"alrusdi","email":"alrusdi@gmail.com"},"dist":{"shasum":"9f82fe29e8e3035f11badb075173defdbe913e34","tarball":"https://registry.npmjs.org/jquery-query-object/-/jquery-query-object-2.2.2.tgz","integrity":"sha512-1ZW65oIkR3kmzTQXaivl3I2aNA7eo7ntl4ebv5On7T45b57PFYrIAaD49JdRW4jdvmK6dDq3BjXcNBN/FNvcyw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCuwUro60TAvkghm5fdWUQ6tPyrAWHJxMgsYlsjNxBl9gIgMMXrnpmzQ436wLawT5GI6X2kszxxwYeZvMxZf4oOLWs="}]}},"2.2.3":{"name":"jquery-query-object","title":"Query String Modification and Creation for jQuery","description":"Query String Modification and Creation for jQuery","keywords":["query","parameter","window.location.search","querystring","deserialize","serialize"],"version":"2.2.3","author":{"name":"Blair Mitchelmore","email":"blair.mitchelmore@gmail.com","url":"https://github.com/blairmitchelmore"},"licenses":[{"type":"WTFPL","url":"http://sam.zoy.org/wtfpl/"}],"bugs":{"url":"https://github.com/alrusdi/jquery-plugin-query-object/issues"},"homepage":"https://github.com/alrusdi/jquery-plugin-query-object","docs":"https://github.com/alrusdi/jquery-plugin-query-object","download":"https://github.com/alrusdi/jquery-plugin-query-object/archive/master.zip","dependencies":{"jquery":">=1.4"},"maintainers":[{"name":"alrusdi","email":"alrusdi@gmail.com"}],"main":"jquery.query-object.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/alrusdi/jquery-plugin-query-object.git"},"license":"ISC","gitHead":"19104670bac1a769f4927390777bb3a4cc60f17a","_id":"jquery-query-object@2.2.3","_shasum":"f250e989f603332ba427cffe98e5cc3fc979266c","_from":".","_npmVersion":"2.7.5","_nodeVersion":"0.10.25","_npmUser":{"name":"alrusdi","email":"alrusdi@gmail.com"},"dist":{"shasum":"f250e989f603332ba427cffe98e5cc3fc979266c","tarball":"https://registry.npmjs.org/jquery-query-object/-/jquery-query-object-2.2.3.tgz","integrity":"sha512-BSIoUqeZrYHA9LWCId42TfVbfGfV8Iryl5MdKcg6ZoccUChSGVnLmvG5RGe8y0e8gq9eboesW7zyR6RcP0FOVA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFlUyQrJJrPjtOeBj3UDLLxkB7vCJeUMZkKJVL7S7BVPAiEAus//GjHGAWWOiQG1drJEkxU9IabmUw+GINhPswvsifg="}]},"_npmOperationalInternal":{"host":"packages-6-west.internal.npmjs.com","tmp":"tmp/jquery-query-object-2.2.3.tgz_1455373927730_0.6077900263480842"}}},"readme":"jquery-plugin-query-object\n==========================\n\nQuery String Modification and Creation for jQuery\n\nThis extension creates a singleton query string object for quick and readable query \nstring modification and creation. This plugin provides a simple way of taking a page's \nquery string and creating a modified version of this with little code.  \n\nDisclaimer  \n-------------------------\n\nThere are many URI manipulation libraries for JS and before use jquery-query-object you should look at least to https://github.com/medialize/URI.js because it much more feature rich, tested and better documented. I support  jquery-query-object because i need it for my existent projects and i want to maintain reference to it on plugins.jquery.com - no other reasons to use it but not URI.js\n\nExample\n-------------------------\n\n```\nvar url = location.search;\n> \"?action=view&section=info&id=123&debug&testy[]=true&testy[]=false&testy[]\"\nvar section = $.query.get('section');\n> \"info\"\nvar id = $.query.get('id');\n> 123\nvar debug = $.query.get('debug');\n> true\nvar arr = $.query.get('testy');\n> [\"true\", \"false\", true]\nvar arrayElement = $.query.get('testy[1]');\n> \"false\"\nvar newUrl = $.query.set(\"section\", 5).set(\"action\", \"do\").toString();\n> \"?action=do&section=5&id=123\"\nvar newQuery = \"\" + $.query.set('type', 'string');\n> \"?action=view&section=info&id=123&type=string\"\nvar oldQuery = $.query.toString();\n> \"?action=view&section=info&id=123\"\nvar oldQuery2 = $.query;\n> ?action=view&section=info&id=123\nvar newerQuery = $.query.SET('type', 'string');\n> ?action=view&section=info&id=123&type=string\nvar notOldQuery = $.query.toString();\n> \"?action=view&section=info&id=123&type=string\"\nvar oldQueryAgain = $.query.REMOVE(\"type\");\n> ?action=view&section=info&id=123\nvar removeElementByValue = $.query.REMOVE('section', 'info');\n> ?action=view&id=123\nvar newerQuery2 = $.query.set('testy[]', 'true').set('testy[]', 'false').set('testy[]', 'true');\n> ?action=view&id=123&testy[0]=true&testy[1]=false&testy[2]=true\nvar removeElementByValue1 = $.query.REMOVE('testy', 'false');\n> ?action=view&id=123&testy[0]=true&testy[1]=true\nvar emptyQuery = $.query.empty();\n> \"\"\nvar stillTheSame = $.query.copy();\n> ?action=view&section=info&id=123\nIn case you dynamically change document.location via history API\nvar parsedQuery = $.query.parseNew(\"?foo=bar\", \"bar=foo\");\n> ?foo=bar&bar=foo\nIn case you are using History.js\nvar parsedQuery = $.query.parseNew(location.search, location.hash.split(\"?\").length > 1 ? location.hash.split(\"?\")[1] : \"\");\n```\n\nFeatures\n-------------------------\n\n * **Chainability**  \n    Like much of jQuery, this object supports chaining set methods to add new key \n    value pairs to the object. In addition, this chain does not modify the original \n    object, but returns a copy which can be modified without changing the original object. \n    You can use the method the 'loud' alternate methods to perform destructive \n    modifications on the original object.\n\n * **Direct Object 'get' Accessor**  \n   The query string object returned contains the keys of the query string through a method named 'get'\n   ```\n   $.query.get(keypath)\n   ```\n * **Easy String Creation**  \n   All modern browsers convert JavaScript objects to their string representation through \n   their 'toString' method. So because this object creates a toString method for itself, \n   when evaluated in a string context, this object returns a valid query string. If the \n   query string object has no keys set, it returns an empty string. If it has keys set, \n   it automatically prefixes the output with a question mark so you don't need to worry \n   about appending one yourself. It's there if you need it and gone if you don't. \n   It also supports arrays and associative arrays inside the query string. Both regular \n   and associative arrays use \"base[key1]=value1&base[key2]=value2\" syntax in the query string.\n   Originally arrays could forgo the square bracket and were simply printed out in their insertion \n   order but with the new deep object support in version 2.0 this had to be removed for the sake of \n   unambiguous keys.\n\n * **Custom url loading**  \n   You can create a new query object based on a provided url through the load method\n\n * **Query String Parsing**  \n   The original url parsing code was created by Jörn Zaefferer and modified by me.   \n   The new parsing features added are:  \n   1. **Parsing Integers**  \n      The original code parsed floats out of strings but left integers as is. \n      In my release, '123' will be converted to the number 123.  \n   2. **Boolean Values**  \n      Query strings can often contain query parameters with no value set. This implies a simple boolean:  \n      ```\n      index.php?debug\n      ```  \n      implies a query string variable 'debug' set to true\n   3. **Improved number parsing**\n      Parsing features introduced in version 1.2 include better support for number formats and differentiating between number-looking strings and numbers.\n   4. **Array syntax parsing**\n      Array shaped query string keys will create an array in the internal jQuery.query structure and using square brackets without an index will generate an array dynamically.\n   5. **Ampersand or semi-colon delimiters**\n      Because it has been requested of me, the parser now supports both semi-colons and ampersands as delimiting marks between key value pairs.\n   6. **Hash parameter parsing**\n      Because it has been requested of me, the parser now supports both query string parsing and parsing of query string like strings in the url hash.\n\n \nCustomization\n-------------------------\n\nThere are now some customizations which can be done, mostly dealing with parsing and with toString generation. The options are set by creating jQuery.query as an object of settings before including the jQuery.query source code on your page as seen below:\n\n```\n<script type=\"text/javascript\">\njQuery.query = { numbers: false, hash: true };\n</script>\n<script type=\"text/javascript\" src=\"jquery.query.js\"></script>\n```\n\nWhen initializing, the query object will check the currently existing jQuery.query for any settings it can use. The settings are:\n\n   1. **separator**  \n      The default value for this setting is '&' as that is the standard for parameter division. However, when working in xml, some prefer to use a semi-colon to separate parameters to avoid overuse of &amp;. The parser has been updated to read semi-colons as delimiters but to output generated query strings with a semi-colon you need to set this setting to ';'\n\n   2. **spaces**  \n      The default value for this is true as most people prefer plus signs in query strings to be converted to spaces. It's standard practice to use plus signs to represent spaces in query strings to avoid the dreaded %20 so the parser has been updated and, by default, converts plus signs to spaces. However, this feature can be disabled if you decide you need literal plus signs in your query strings.\n\n   3. **suffix**  \n      The default for this is true. If set to true, any arrays, when outputted to a query string will be suffixed with \"[]\" to show them as an array more clearly. Some may prefer to generate array strings without the square brackets and can set this value to false. I set this to true by default because I prefer one element arrays to be unambiguously arrays when generated in a query string.\n\n   4. **hash**  \n      The default for this is false. If set to true, the output of a query string will be prefixed by a hash '#' rather than a question mark. Given the interest in parsing hash parameters along with query string parameters, this seemed like a good setting to introduce.\n\n   5. **prefix**  \n      The default for this is true. If set to false, the output of a query string is not prefixed by a hash or question mark.\n\n   6. **numbers**  \n      The default for this is true. If set to false, numbers in query strings will NOT be parsed. This helps when left-hand zeros in a number are significant for some reason.\n\nLimitations\n-------------------------\n\n* **Direct Object Access**  \n    Direct object access has been removed from this plugin as it wasn't symmetric (ie it was only usable for getting, not setting) and for safety reasons.\n\n* **Boolean false Values**  \n    Because true values are parsed and represented as attributes without distinct values, false is represented as a lack of attribute. Because of this, attempting to set an attribute to 'false' will result in its removal from the object. This is a design decision which may be made a customizable setting in the future.\n\n* **Key Complexity**  \n    Version 2.0 and above now supports deep objects just as well as PHP's built in $_GET object.\n","maintainers":[{"name":"alrusdi","email":"alrusdi@gmail.com"}],"time":{"modified":"2022-06-19T05:10:00.897Z","created":"2015-04-05T12:12:42.683Z","2.2.2":"2015-04-05T12:12:42.683Z","2.2.3":"2016-02-13T14:32:11.018Z"},"homepage":"https://github.com/alrusdi/jquery-plugin-query-object","keywords":["query","parameter","window.location.search","querystring","deserialize","serialize"],"repository":{"type":"git","url":"https://github.com/alrusdi/jquery-plugin-query-object.git"},"author":{"name":"Blair Mitchelmore","email":"blair.mitchelmore@gmail.com","url":"https://github.com/blairmitchelmore"},"bugs":{"url":"https://github.com/alrusdi/jquery-plugin-query-object/issues"},"license":"ISC","readmeFilename":"README.md"}