Area.protocol

JavaScript 1.1+, JScript 1.0+ Nav3+, IE 3+, Opera3+ Syntax

document.links[num].protocol

Description

The protocol property contains the protocol (http:, file:, ftp:, and so on) specified in the URL, including the ending colon (:). This property is a read/write string.

Example

In Listing 7.18, the protocol property containing http: is displayed below the area link.

Listing 7.18 Accessing the protocol Property of an Area Object
 <html> <h2>The Color Page</h2> <map name="colorMap"> <area name="greenArea" coords="1,1,48,48" href="http://www.green.com:5678/green.html?query=green#GREEN" target="_top"> </map> <img src="box4.gif" align="top" height="100" width="100" usemap="#colorMap"> <script> <!-- Hide //Display the protocol associated ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.