To get current URL in JavaScript you just need to use the URL property of the document object.

Sample Javascript

var currUrl = document.URL;

for more informations see The absolute URI of the document

2 thought on “How to get current URL in JavaScript”

Leave a Reply