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');
Get the value of a key in the url query.
Name | Type | Description |
---|---|---|
key |
string | Key to find value for |
string|undefined
: Value of key. undefined
if key does not exist.
// Url: example.com?test=popcorn
ds.utils.url.getQuery('test'); // => 'popcorn'
ds.utils.url.getQuery('invalid'); // => undefined