This property yields a text string that contains the pathname value from the URL if there is one and an empty string if not.
MSIE and Netscape support the use of this property as an LValue. If you write to it, the pathname portion of the HREF value is modified. Be careful not to include a hash or search/query value.
<HTML> <HEAD> </HEAD> <BODY> <A NAME="EXAMPLE" HREF="http://www.mydomain.com:8080/folder/file.html#abcdef">Click here</A><BR> <SCRIPT> document.write(document.links[0].pathname); </SCRIPT> </BODY> </HTML>
See also: | Anchor.hash, Anchor.pathname, URL, Url object, Url.hash, Url.host, Url.hostname, Url.href, Url.port, Url.protocol, Url.search, Url.target |
Prev | Home | Next |
Url.nameProp | Up | Url.port |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |