After fetching lat and lng values from sessionStorage, my goal is to send them to the browser using window.location. However, I'm encountering an infinite loop issue.
var lat = sessionStorage.getItem('lat');
var lng = sessionStorage.getItem('lng');
window.location = '?lat='+lat+'&lng='+lng;
I have seen similar questions about this problem but none of the solutions seem to work for me. I have tried different methods such as window.location.hash / href, but the outcome is not what I anticipated.
Does anyone have a proper solution for implementing this function correctly? Thank you very much.