Open mveer-agarwal opened 6 years ago
I have modified the firePopState method by adding a Map, which keeps the URL and state of object in case of IE/Edge.
function firePopState(currentUrl) { var o = document.createEvent ? document.createEvent('Event') : document.createEventObject(); var currentUrl = currentUrl; var NextUrl = windowLocation.href; if (o.initEvent) { o.initEvent('popstate', false, false); } else { o.type = 'popstate'; } if (historyMap[NextUrl]) { o.state = historyMap[NextUrl]; delete historyMap[NextUrl]; historyObject.replaceState(null, "", NextUrl); } else { historyMap[currentUrl] = historyObject.state; } // o.state = historyObject.state; // send a newly created events to be processed dispatchEvent(o); }
Please suggest.
I have modified the firePopState method by adding a Map, which keeps the URL and state of object in case of IE/Edge.
Please suggest.