Techdocs

AMP Web SDK

AMP player

akamai.amp.QueryString

A utility class for retrieving query string parameters.

Constructor

QueryString

new QueryString()
Example
// url = "http://testing.com/?a=testing&b=true&c=1234";
assert(akamai.amp.QueryString.a == "testing");
assert(akamai.amp.QueryString.b == "true");
assert(akamai.amp.QueryString.typed.b == true);
assert(akamai.amp.QueryString.c == "1234");
assert(akamai.amp.QueryString.typed.c == 1234);

Members

typed

(static)

A collection of query string parameters as typed JS values

Methods

decode

(static) decode(value) → {object}

Decode a string into a JS object

Parameters
Name Type Description
value string

A string to decode as a JS object

Returns
object

encode

(static) encode(value) → {string}

Encode an object as a query string

Parameters
Name Type Description
value object

A JS object to encode as query string variables

Returns
string