Javascript Reference
Categories: location

javascript location protocol

@March 15, 2008, 1:22 a.m.
protocolFirefox/Netscape/NN 2 IE 3 Chrome/Safari/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.


Powered by Linode.