August 1999
Intermediate to advanced
1488 pages
72h 53m
English
link.host
The host property represents the host portion of the URL.
Listing 7.361 shows how to use the host property. When the button is clicked, the showHost() function is called to show the value of the host property.
<html>
<head>
<title> Using the host property of the Link object</title>
</head>
<body>
<script language="JavaScript">
<!-- Hide
// function shows the host value
function showHost(){
document.form1.text1.value = document.links[0].host;
}
// End Hide --->
</script>
Click the button to see the host for the URL <form name="form1"> <a href=http://www.mcp.com:80/foo?something#foobar> http://www.mcp.com:80/foo?something#foobar</a> ... |
Read now
Unlock full access