How to get the path name of the current web page in JavaScript

1 Answer

0 votes
document.write("The path name of the current web page is: " + window.location.pathname);    
            
/*
run:
  
The path name of the current web page is: /test.html 
  
*/

 



answered Jul 13, 2015 by avibootz
...