asp.net.ph

Skip Navigation Links

protocol Property

location Properties   DHTML Objects


Returns the access method of a URL.

Syntax


HTML N/A
Script object.protocol [ = sProtocol ]

Possible Values


sProtocol Specifies the protocol used to transfer information.

The property is read/write with no default value.

Remarks

The protocol property specifies how information is transferred from the host to the client. Microsoft® Internet Explorer® supports several predefined protocols, including http and ftp.

The protocol property returns the initial substring of a URL, including the first colon ( for example: http: ). However, the document and location objects expose the protocol property as read-only and the property returns the expanded text of the protocol acronym. For example, the http protocol is returned as Hypertext Transfer Protocol.

Example

The following example displays the document protocol property in a message box.

alert ( document.protocol ) 

 Show me 

Applies To

A, AREA, document, IMG, location



>

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note