url.query
url.query
Function
Read the query parameter object of the current URL.
Syntax
url(text).query()
Parameters
None.
Return value
| Type | Description |
|---|---|
| Object | Returns the query parameter dynamic key value object. See below for field rules. |
Return object fields
| Field | Type | Must exist | Description |
|---|---|---|---|
| Any query parameter name | String | No | URL decoded query parameter value. When the parameter does not exist, the field does not exist, and the read result is empty. |
Code Example
query = url('https://btlang.org/docs?q=BT%20Lang').query() // Output: BT Lang print query.q
Notes
- The value that appears after a repeated parameter name overwrites the previous value.
- Returns an empty Object if there is no query string.