Sets or retrieves the protocol portion of a URL.
dhtml语法
HTML | N/A |
---|
Scripting | object.protocol [ = sProtocol ] |
---|
DHTML可能的值
sProtocol | String that
specifies or receives the protocol used to transfer information. |
The property is read/write.
The property has no default value.
Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see about dynamic properties.
remarks
the protocol property specifies how to transfer information from the host to the client. microsoft® internet explorer supports several predefined protocols, including http and ftp.
the document, img, and location objects expose the protocol property as read-only. location.protocol property returns the initial substring of a url, including the first colon (for example, http:). however, document.protocol returns the expanded text of the protocol acronym. for example, it returns the http protocol as hypertext transfer protocol.
DHTML代码范例
This example function returns the protocol property of the current page location.
function getProtocol()
{
return document.location.protocol;
}
是否符合公共标准
There is no public standard that applies to this property.
Applies To