Prototype - Hash toQueryString() Method

This method turns a hash into its URL-encoded query string representation.

This is a form of serialization, and is mostly useful to provide complex parameter sets for stuff such as objects in the Ajax namespace (e.g. Ajax.Request).

Undefined-value pairs will be serialized as if empty-valued. Array-valued pairs will get serialized with one name/value pair per array element. All values get URI-encoded using JavaScript's native encodeURIComponent function.