Get url with Javascript without GET

Asked

Viewed 1,111 times

4

  • 1

    What is the reason for this? Anyway, to not have the parameters in the url, send by the POST method. Or just want to extract the url without parameters? If so, invoke the property pathname. ex: window.location.pathname

1 answer

4


Just try to get the path

var url = window.location.pathname
  • Oops, truth, it was exactly the pathname you should have used.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.