August 1999
Intermediate to advanced
1488 pages
72h 53m
English
location.pathname
The pathname property of the Location object represents the pathname portion of the URL.
In the following fictitious Web address:
http://www.mcp.com:80/foo?something#foobar
the pathname value would be the /foo portion.
Listing 7.384 shows an example of how to get the pathname.
<html>
<head>
<title> Using the pathname property of the Location object</title>
</head>
<body>
<script language="JavaScript">
<!-- Hide
// function to display the pathname value
function show(){
document.form1.text1.value=document.location.pathname;
}
// End Hide ---> </script> <form name="form1"> ... |
Read now
Unlock full access