Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

get current url pathreact

console.log(window.location.pathname); //yields: "/js" (where snippets run)
console.log(window.location.href);     //yields: "https://stacksnippets.net/js"
 Run code snippet
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #current #url #pathreact
ADD COMMENT
Topic
Name
8+8 =