javascript location protocol

protocolNN 2 IE 3 DOM n/a  

Read/Write  

Provides the protocol component of the URL. This consists of all URL information up to and including the first colon of a URL. Typical values are: "http:", "file:", "ftp:", and "mailto:".

 
Example
 
if (location.protocol == "file:") {
    // statements for treating document as local file
}
 
Value

String.

 
Default

None.


1206,Nickname,Homepage or email,Comments here,Add comment