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