How to change the path name property in Location object in Javascript

pathname property

The pathname property can be set with new values that alter the current URL.

Example


<!DOCTYPE HTML> 
<html> 
    <body> 
        <script> 
               location.pathname = "mydir"; 
        </script> 
    </body> 
</html><!--from   w w w .  j  a  v a  2 s. co m-->

Click to view the demo





















Home »
  Javascript »
    Javascript Reference »




Array
Canvas Context
CSSStyleDeclaration
CSSStyleSheet
Date
Document
Event
Global
History
HTMLElement
Input Element
Location
Math
Number
String
Window