SHARE
TWEET

Untitled

a guest Aug 26th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var utils = (function () {
  2.  
  3.     var getParameter = function (name, url) {
  4.         if (!url) url = window.location.href;
  5.         name = name.replace(/[\[\]]/g, "\\$&");
  6.         var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
  7.             results = regex.exec(url);
  8.         if (!results) return null;
  9.         if (!results[2]) return '';
  10.         return decodeURIComponent(results[2].replace(/\+/g, " "));
  11.     };
  12.  
  13.     var redirect = function (url) {
  14.  
  15.         window.location.href = url;
  16.  
  17.     };
  18.  
  19.     return {
  20.         getParameter: getParameter,
  21.         redirect:redirect
  22.     };
  23.  
  24. })();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top