Skip to content

Latest commit

 

History

History
40 lines (27 loc) · 699 Bytes

url.md

File metadata and controls

40 lines (27 loc) · 699 Bytes

ds.utils.url

Helper functions working with URLs.

In browser:

<script src="scripts/libs/ds-frontend/scripts/utils/url.js"></script>
<script>
    ds.utils.url;
</script>

With browserify:

var url = require('ds-frontend/scripts/utils/url');

#.getQuery(key)

Get the value of a key in the url query.

Name Type Description
key string Key to find value for

Return

string|undefined: Value of key. undefined if key does not exist.

Example

// Url: example.com?test=popcorn
ds.utils.url.getQuery('test'); // => 'popcorn'
ds.utils.url.getQuery('invalid'); // => undefined