From 70b59c923ade3381f7baabb8aa3fe84541bff949 Mon Sep 17 00:00:00 2001 From: Adriaan Wormgoor Date: Fri, 16 Aug 2013 22:23:24 +0200 Subject: [PATCH] new utils file for general methods. This first method grabs the query string variables from the URL --- js/utils.js | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 js/utils.js diff --git a/js/utils.js b/js/utils.js new file mode 100644 index 0000000..5ab9f65 --- /dev/null +++ b/js/utils.js @@ -0,0 +1,7 @@ + +// http://stackoverflow.com/questions/1403888/get-url-parameter-with-jquery +function getURLParameter(name) { + return decodeURI( + (new RegExp('[&?]'+name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1] + ); +}