SAPO::Utility.Args->parseQuery

This method will parse an URL query string (ie: arg1=val1&arg2=val2&...) and return an equivalent JSON object.

{'arg1':'val1','arg2':'val2',...}

This is widely used in our Snippets repository.

This is a static method.

Syntax

SAPO.Utility.Args.parseQuery(query)

Compatibility

All browsersYes

Depends

Input Parameters

  • (string) query : Input query string

Sample

 http://js.sapo.pt/SAPO/Utility/Args/sample/

Example

var query='arg1=val1&arg2=val2&arg3=val3';
var obj=SAPO.Utility.Args.parseQuery(query);
SAPO.Utility.Dumper.alertDump(obj);

Community feedback

Error: Failed to load processor AddComment
No macro or processor named 'AddComment' found