Skip to content

KAZOO Support Channels

This documentation is curated by 2600Hz as part of the KAZOO open source project. Join our community forums here for peer support. Only features in the docs.2600hz.com/supported space are included as part of our 2600Hz Support Services plan.

monster.util.getUrlVars()#

Syntax#

monster.util.getUrlVars([key]);

Parameters#

Key Description Type Default Required
key Specific query string parameter to return. String false

Return value#

  • an Object literal representing every URL parameters
  • a String representation of the value corresponding to key
  • an Array representation of the value corresponding to key
  • undefined when key does not match a property

Description#

This method returns the different URL GET parameters of the window.

Examples#

// url: http://mycompany.com/monster?page=documentation&date=142109383929
monster.util.getUrlVars();
// => { page: 'documentation', date: '142109383929' }
monster.util.getUrlVars('page');
// => 'documentation'
monster.util.getUrlVars('nope');
// => undefined

// url: http://mycompany.com/monster?page[]=documentation&page[]=about
monster.util.getUrlVars();
// => { page: ['documentation', 'about'] }
monster.util.getUrlVars('page');
// => ['documentation', 'about'']

// url: http://mycompany.com/monster?page[2]=documentation&page[4]=about
monster.util.getUrlVars();
// => { page: [null, null, 'documentation', null, 'about' ] }

// url: http://mycompany.com/monster?page[2]=documentation&page[4]=about
monster.util.getUrlVars();
// => { page: [null, null, 'documentation', null, 'about' ] }