diff --git a/js/index.js b/js/index.js index de6ae23..8476086 100644 --- a/js/index.js +++ b/js/index.js @@ -382,7 +382,21 @@ function FilterSelector() { return root; } window.onload = function () { - feature_params = new URLSearchParams(document.location.search).has("feature-params"); + if (URLSearchParams) { + feature_params = new URLSearchParams(document.location.search).has("feature-params"); + } + else { + var query = document.location.toString().split('?')[1]; + feature_params = false; + if (query) { + for (var _i = 0, _a = query.split('&'); _i < _a.length; _i++) { + var el = _a[_i]; + if (el === "feature-params") { + feature_params = true; + } + } + } + } var filterSelectorEntry = document.getElementById('filter-selector-entry'); if (filterSelectorEntry === null) { throw new Error('Could not find "filter-selector-entry"'); diff --git a/ts/index.ts b/ts/index.ts index 4c8abf2..6d90568 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -512,7 +512,21 @@ function FilterSelector() { } window.onload = () => { - feature_params = new URLSearchParams(document.location.search).has("feature-params"); + if (URLSearchParams) { + feature_params = new URLSearchParams(document.location.search).has("feature-params"); + } else { + // IE support + const query = document.location.toString().split('?')[1]; + feature_params = false; + if (query) { + // IE doesnt have Array.includes() + for (const el of query.split('&')) { + if (el === "feature-params") { + feature_params = true; + } + } + } + } const filterSelectorEntry = document.getElementById('filter-selector-entry'); if (filterSelectorEntry === null) {