btcpayserver/BTCPayServer/wwwroot/checkout/js/querystring.js

13 lines
433 B
JavaScript
Raw Normal View History

const urlParams = {};
2018-03-22 23:02:53 -05:00
(window.onpopstate = function () {
let match,
2018-03-22 23:02:53 -05:00
pl = /\+/g, // Regex for replacing addition symbol with a space
search = /([^&=]+)=?([^&]*)/g,
decode = function (s) { return decodeURIComponent(s.replace(pl, " ")); },
query = window.location.search.substring(1);
while (match = search.exec(query)) {
2018-03-22 23:02:53 -05:00
urlParams[decode(match[1])] = decode(match[2]);
}
2018-03-22 23:02:53 -05:00
})();