Files
freeCodeCamp/guide/russian/javascript/tutorials/get-current-url-in-javascript/index.md
2018-10-16 21:32:40 +05:30

15 lines
544 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Get Current Url in JavaScript
localeTitle: Получить текущий URL в JavaScript
---
Чтобы получить **текущий URL-адрес** :
```
var url = window.location.href;
```
Чтобы получить **текущий путь** :
```
var path = window.location.path;
```
Более подробную информацию о объекте местоположения и его свойствах можно найти [здесь](https://developer.mozilla.org/en-US/docs/Web/API/Window/location) .