Update getProtocol.md
This commit is contained in:
@ -5,7 +5,7 @@ tags: browser,beginner
|
|||||||
|
|
||||||
Returns the protocol being used on the current page.
|
Returns the protocol being used on the current page.
|
||||||
|
|
||||||
- Can be either `http:` or `https:`
|
- Use `window.location.protocol` to get the protocol (`http:` or `https:`) of the current page.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const getProtocol = () => window.location.protocol;
|
const getProtocol = () => window.location.protocol;
|
||||||
|
|||||||
Reference in New Issue
Block a user