PHP _GET不会使用URL动态更新



var baseURL = "";
// clears the last query params
history.pushState("", document.title, baseURL);
// retrieves the value from the HTML code
var value = document.getElementById('id').value;

// URL with updated query params
var updatedURL = document.URL + "?value=" + value;
// pushing the new URL without refreshing the page.
history.pushState("", document.title, updatedURL);

// URL looks something like this ""

But when I try to use _GET['value'] to retrieve the value from the URL, it only gets the value the page initialized with and does not update dynamically, is there any way to retrieve this value without having to refresh the page?