Link.protocol

JavaScript 1.0+, JScript 1.0+ Nav2+, IE 3+, Opera3+ Syntax

							link.protocol

Description

The protocol property of the Link object represents the protocol being used in the current Web browser. This is the first piece of text in the URL.

Example

Listing 7.375 shows how you can get the protocol type being used. When the button is clicked, the protocol for the link is displayed.

Listing 7.375 Example of the protocol Property
<html>
<head>
<title> Using the protocol property of the Link object</title>
</head>
<body>

<script language="JavaScript">
<!--Hide

// displays the type of protocol being used for the URL
function showproto(){
     document.form1.text1.value = document.links[0].protocol;
}
// End Hide --->
</script>
							 Click the ...

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.