javascript get variable from the url code example
Example 1: js get url variables
const postID = (new URLSearchParams(window.location.search)).get('post');
Example 2: set get variable in url
examplepage.php?var1=value&var2=value
const postID = (new URLSearchParams(window.location.search)).get('post');
examplepage.php?var1=value&var2=value