diff options
author | Indrajith K L | 2017-01-17 15:37:25 +0530 |
---|---|---|
committer | Indrajith K L | 2017-01-17 15:37:25 +0530 |
commit | 550e2f03ad0b60b3c9db3d68dbf014dcb740a2ff (patch) | |
tree | faf6bff0bdde8f01514a3f59ecca943569647c40 /src/urlparser.js | |
download | JSTemplate-550e2f03ad0b60b3c9db3d68dbf014dcb740a2ff.tar.gz JSTemplate-550e2f03ad0b60b3c9db3d68dbf014dcb740a2ff.tar.bz2 JSTemplate-550e2f03ad0b60b3c9db3d68dbf014dcb740a2ff.zip |
Initial Commit
Diffstat (limited to 'src/urlparser.js')
-rw-r--r-- | src/urlparser.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/urlparser.js b/src/urlparser.js new file mode 100644 index 0000000..7f12df9 --- /dev/null +++ b/src/urlparser.js @@ -0,0 +1,10 @@ +define(['jquery'], function($) { + $.urlParam = function(name) { + var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href); + if (results == null) { + return null; + } else { + return results[1] || 0; + } + } +}) |