JavaScript Window location.protocol
JavaScript Window location.protocol
The location.protocol property is used to either set or return the protocol of the current URL. It also includes the colon (:). It is a standard that is used to specify how data are transmitted between computers.
Syntax:-
Its syntax is:- location.protocol OR location.protocol = protocol
Return:-
Its return is:- a string containing protocol of current URL
Further Explanation:-
Parameter | Description |
protocol | The protocol of the URL. They are file, FTP, HTTP, HTTPS, mailto. |