diff options
author | Steve Manuel <nilslice@gmail.com> | 2016-10-30 23:38:11 -0700 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2016-10-30 23:38:11 -0700 |
commit | e747830167e22d97ea34969fab3cfe1c71c35f75 (patch) | |
tree | 340881ad490d7c2519698dc486fab99e3e76c38a /system/admin/static/common/js | |
parent | dd4a88bed52b6127503824218fb97645d44e1a7d (diff) |
pulling getParam into utils file
Diffstat (limited to 'system/admin/static/common/js')
-rw-r--r-- | system/admin/static/common/js/util.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/system/admin/static/common/js/util.js b/system/admin/static/common/js/util.js index 7f4c8ab..8d5e74b 100644 --- a/system/admin/static/common/js/util.js +++ b/system/admin/static/common/js/util.js @@ -67,4 +67,20 @@ function getPartialDate(unix) { d.dd = day; return d; +} + +// Returns a part of the window URL 'search' string +function getParam(param) { + var qs = window.location.search.substring(1); + var qp = qs.split('&'); + var t = ''; + + for (var i = 0; i < qp.length; i++) { + var p = qp[i].split('=') + if (p[0] === param) { + t = p[1]; + } + } + + return t; }
\ No newline at end of file |