#

API Docs for: 3.10.3
Show: Inherited Protected Private Deprecated

# QueryString Class

Defined in: `querystring/js/querystring-parse.js:29`
Module: querystring-parse
Parent Module: querystring

The QueryString module adds support for serializing JavaScript objects into query strings and parsing JavaScript objects from query strings format.

- Index
- Methods

## Item Index

### Methods

- escape static
- parse static
- stringify static
- unescape static

## Methods

### `escape`

() static

Provided by the querystring-stringify module.

Defined in `querystring/js/querystring-stringify.js:12`

Provides Y.QueryString.escape method to be able to override default encoding method. This is important in cases where non-standard delimiters are used, if the delimiters would not normally be handled properly by the builtin (en|de)codeURIComponent functions. Default: encodeURIComponent

### `parse`

(

- `qs`
- `sep`
- `eq`

)
public static

Defined in `querystring/js/querystring-parse.js:119`

Accept Query Strings and return native JavaScript objects.

#### Parameters:

- `qs` String

  Querystring to be parsed into an object.

- `sep` String

  (optional) Character that should join param k=v pairs together. Default: "&"

- `eq` String

  (optional) Character that should join keys to their values. Default: "="

### `stringify`

(

- `obj`
- `cfg`
- `name`

)
public static

Provided by the querystring-stringify module.

Defined in `querystring/js/querystring-stringify.js:25`

Converts an arbitrary value to a Query String representation.

Objects with cyclical references will trigger an exception.

#### Parameters:

- `obj` Variant

  any arbitrary value to convert to query string

- `cfg` Object

  (optional) Configuration object. The three supported configurations are:

  - sep: When defined, the value will be used as the key-value separator. The default value is "&".
  - eq: When defined, the value will be used to join the key to the value. The default value is "=".
  - arrayKey: When set to true, the key of an array will have the '[]' notation appended to the key. The default value is false.
- `name` String

  (optional) Name of the current key, for handling children recursively.

### `unescape`

(

- `s`

)
public static

Defined in `querystring/js/querystring-parse.js:141`

Provides Y.QueryString.unescape method to be able to override default decoding method. This is important in cases where non-standard delimiters are used, if the delimiters would not normally be handled properly by the builtin (en|de)codeURIComponent functions. Default: replace "+" with " ", and then decodeURIComponent behavior.

#### Parameters:

- `s` String

  String to be decoded.