Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js change url in address bar

   let newurl = window.location.protocol + '//' + window.location.host + 'path you want'
    if (history.pushState) {
      window.history.pushState({ path: newurl }, 'title',newurl)
    } else {
      window.history.replaceState({ path: newurl }, 'title', newurl)
    }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #change #url #address #bar
ADD COMMENT
Topic
Name
4+9 =