Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

How to get current URL with Javascript or React

const currentURL = window.location.href // returns the absolute URL of a page

const pathname = window.location.pathname //returns the current url minus the domain name
Source by surajsharma.net #
 
PREVIOUS NEXT
Tagged: #How #current #URL #Javascript #React
ADD COMMENT
Topic
Name
3+4 =