August 1999
Intermediate to advanced
1488 pages
72h 53m
English
location.hostname
The hostname property of the Location object represents the hostname portion of the URL.
In the following fictitious Web address:
http://www.mcp.com:80/foo?something#foobar
the hostname value would be the http://www.mcp.com portion.
Listing 7.382 shows an example of how the hostname property is used. When the button is clicked, the show() function is called, which displays the value of hostname in the text box.
<html> <head> <title> Using the hostname property of the Location object</title> </head> <body> <script language="JavaScript"> <!-- Hide // displays the hostname ... |
Read now
Unlock full access