I am facing to problem with method new URL(\'address\') in IE.
I have this code:
var href = location.href;
var hrefParams = new URL(href);
var api =
modified @ales code for getting the value of a particular parameter. The default value is set to false
.
function getUrlVars(index) {
var vars = {};
window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (
m,
key,
value
) {
vars[key] = value;
});
if (index) {
return vars[index] || false;
}
return vars;
}