August 1999
Intermediate to advanced
1488 pages
72h 53m
English
link.hostname
The hostname property of the Link object represents the hostname portion of the link's URL.
Listing 7.362 shows an example of how the hostname is used. When the button is clicked, the showHostname() function is called, which displays the value of the hostname for the link.
<html>
<head>
<title> Using the hostname property of the Link object</title>
</head>
<body>
<script language="JavaScript">
<!-- Hide
// displays the hostname for the URL
function showHostname(){
document.form1.text1.value = document.links[0].hostname;
}
// End Hide --->
</script>
Click the button to see the hostname ... |
Read now
Unlock full access