Skip to main content

Archive

Show more

How to get the current page URL with JavaScript

how-to-get-current-page-url-with-javascript


Question: How to get the current page URL with JavaScript

Answer:

first method

document.URL

second method

window.location.href

third method

 document.baseURI

Output:

https://www.rustcodeweb.com/2021/07/how-to-get-current-page-url-with-javascript.html


We try to provide you the best content, if there is any mistake in this article or there is any mistake in code, then let us know.

Comments