Location pathname Property
Location Object
Definition and Usage
The pathname property returns the path name of a URL.
Syntax
Browser Support

The pathname property is supported in all major browsers.
Example
Example
Return the path name of the current URL:
<script type="text/javascript">
document.write(location.pathname);
</script>
|
The output of the code above will be:
Try it yourself »
|
Location Object
|