HTML DOM pathname Property
Definition and Usage
The pathname property sets or returns the path of the current URL.
Syntax
Example
Assume that the current URL is: http://example.com/test/test.htm#part2:
<html>
<body>
<script type="text/javascript">
document.write(location.pathname);
</script>
</body>
</html>
|
Output:
Try-It-Yourself Demos
Use the
pathname property of the location object
Learn XML with <oXygen/> XML Editor - Free Trial!
|
|
oXygen helps you learn to define,
edit, validate and transform XML documents. Supported technologies include XML Schema,
DTD, Relax NG, XSLT, XPath, XQuery, CSS.
Understand in no time how XSLT and XQuery work by using the intuitive oXygen debugger!
Do you have any XML related questions? Get free answers from the oXygen
XML forum
and from the video
demonstrations.
Download a FREE 30-day trial today!
|
|