I am forcing my page to change the url without refreshing the page
var pageurl = "mypage.php?myTerm"+newTerm;
if(pageurl!=window.location){
window.history.pushState({path:pageurl},'',pageurl);
}
which works great to change the url to newTerm as in mypage.php?myTerm=newTerm
but not if I run
$term = $_GET["myTerm"];
I end up with the oldTerm before the url change. The only way the _GET picks up newTerm is if I hit refresh, which puts me at square 1.