From 550e2f03ad0b60b3c9db3d68dbf014dcb740a2ff Mon Sep 17 00:00:00 2001 From: Indrajith K L Date: Tue, 17 Jan 2017 15:37:25 +0530 Subject: Initial Commit --- src/urlparser.js | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/urlparser.js (limited to 'src/urlparser.js') 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; + } + } +}) -- cgit v1.2.3